xmlparse
[xmlparse] enables the input of XML data into a WebDNA variable, after which any part of the XML structure can be readily examined using the WebDNA XML contexts. [xmlparse] is the first step in interpreting XML so that its contents can be used within WebDNA.
Parameters
Parameter | Description |
---|---|
var | The variable name specified to represent the XML parsed object |
source | A URL reference to an external XML file. If 'source' is provided, the content within the [xmlparse...] and [/xmlparse] context is ignored. |
Example WebDNA code:
This example uses an example file that you can view/download here example-file.xml
Internally, WebDNA 'saves' this parsed instance as an internal variable named 'xml_var1'. This saved instance can then be referenced in the other WebDNA XML contexts on the same page.
This example uses an example file that you can view/download here example-file.xml
[xmlparse var=xml_var1][include file=example-file.xml][/xmlparse]
Internally, WebDNA 'saves' this parsed instance as an internal variable named 'xml_var1'. This saved instance can then be referenced in the other WebDNA XML contexts on the same page.
In the example, the [include] tag is used to place the xml file contents within the [xmlparse] context. The complete XML data can be used in place of an included file.
If the source url in the [xmlparse] context contains an ampersand then it must be url'd [url]...[/url] so that any '&' in the query portion of the URL is not interpreted as a WebDNA parameter delimiter.
Example WebDNA code:[xmlparse var=xml_var1&source=[url]http://www.domain.com?parameter1=a¶meter2=b[/url]][/xmlparse]