Similar in format to XML, Yahoo! Markup Language (YML) provides functionality to YAP modules in a safe and standardized fashion. As a YAP developer, you have the option of including YML in the code you write for YAP modules. YML is proprietary– it was invented by Yahoo! and runs only on YAP. Except for those written in JavaScript, YAP modules can return YML. The internal YAP module generators process the YML and convert it into HTML. If necessary, JavaScript libraries on the end-points attach dynamic behaviors in the user’s browser.
YML offers the following benefits:
Dynamic and secure interactions: Some YML tags provide UI widgets and and rich interactions that normally require untrusted JavaScript.
Data encapsulation: YML tags allow sensitive or timely data to be presented to end-users in a uniform manner. For example, a module might emit the YML tag <yml:mailing-address userid="12345"/>
The YML interpreter will replace this tag with user 12345’s mailing address only if the viewer has access. The application never has direct access to the raw data displayed. Another example is the tag stock <yml:stock symbol="YHOO"/>, which might be replaced with Yahoo’s stock price with a link back to Yahoo! Finance.
Scripting: YML may also provide relatively complex scripting capabilities, such as flow control, data access, and manipulation.
Basic Example:
<yml:module>
Hi. I am a module.
<yml:ajax-link params="foo="bar"">
Click Me
</yml:ajax-link>
<p>Foo=<yml:get name="foo"/></p>
</yml:module>
YML Tags must conform to the following rules:
Some YML tags (including yml:a, yml:form, yml:include, and yml:message) have an attribute called params. The value of this attribute must conform to RFC 39861. Avoid common mistakes such as unescaped spaces, entities (e.g. &), and reverse encoding (percent-encoding of reserved characters used as delimiters or failure to percent-encode reserved characters used as data). Nonconforming syntax can cause runtime errors.
Unless otherwise documented, the params attribute specifies a path relative to your application’s URL, subject to the following rules: