Beginner question: Accessing XML-Attributes via Template?
Tarik Mustafic <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
Hello everybody,
I'm trying to parse a XML-Document with Freemarker and to merge the
model with a template, especially accessing the XML-Attributes from the
model. I have done the following:
--------------------- code
Map<String, Object> root = new HashMap<String, Object>();
root.put("doc", freemarker.ext.dom.NodeModel.parse(new File("file.xml")));
--------------------- code
The XML-document looks like as follows:
--------------------- code
<?xml version="1.0" encoding="UTF-8"?>
<bdd:bWorkflow xsi:schemaLocation="..." xmlns:bdd="..." xmlns:xsi="...">
<bdd:wsbpelEngineInformation wsbpelProcess="..."
wsbpelProcesslocation="...">
<bdd:versioning version="..."/>
<bdd:persistence storePersistent="..."/>
<bdd:partnerLinks>
<bdd:partnerLink name="...">
<bdd:myRole>
<bdd:endpointReference
serviceName="..."
servicePort="..."
binding="..."
xmlns:pal="..."/>
</bdd:myRole>
</bdd:partnerLink>
<bdd:partnerLink name="...">
<bdd:partnerRole bdd:serviceType="..."
bdd:serviceCall="..."/>
</bdd:partnerLink>
</bdd:partnerLinks>
<bdd:extensions/>
<bdd:references>
<bdd:reference location="..." referenceGroup="..."
namespace="..."/>
<bdd:reference location="..." referenceGroup="..."
namespace="..."/>
</bdd:references>
</bdd:wsbpelEngineInformation>
</bdd:bWorkflow>
--------------------- code
Now my question: How can I access the XML-Attribute elements in the
Template? For example how to get the version-Attribute of the
versioning-Element etc?
Thanks in advance.
Kind regards.
Tarik
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com