cancel
Showing results for 
Search instead for 
Did you mean: 

Traverse XML file

vss123
Champ in-the-making
Champ in-the-making
I have a requirement to write a web script that should respond with a list of XMLs. So, I have decided to achieve it by composing response XML with content from all the XMLs.

So, I have to strip of the declaration (<?xml version="1.0" encoding="UTF-8"….>) of each XML and take the remaining to compose response XML. Is there any way to do this? Does JavaScript API has features to process XML document?
5 REPLIES 5

mikeh
Star Contributor
Star Contributor
Yes, the version of Rhino we use supports E4X for XML processing

Thanks,
Mike

vss123
Champ in-the-making
Champ in-the-making
Yes, the version of Rhino we use supports E4X for XML processing

Thanks,
Mike

Fine.. In Ftl, how to print the XML fragment?

mikeh
Star Contributor
Star Contributor
In Ftl, how to print the XML fragment?
Depends exactly what you want to do, but there's a good set of docs on the Freemarker site: http://freemarker.org/docs/xgui_imperative_learn.html

Thanks,
Mike

vss123
Champ in-the-making
Champ in-the-making
In Ftl, how to print the XML fragment?
Depends exactly what you want to do, but there's a good set of docs on the Freemarker site: http://freemarker.org/docs/xgui_imperative_learn.html

Thanks,
Mike
Ya.. These documents I have seen already. My requirements is bit tricky.
I have to write XML content as it is. When i use root?html / root?xml/ root?string, it says It cant do that cos, it has a child inside. I just want to write as it is.

rmorant
Champ in-the-making
Champ in-the-making
Hi,

If you handles the documents in the template you can use all the power of freemarker.
(http://freemarker.org/docs/xgui_declarative_basics.html)
the problem is how to parse the xml string.
look at my topic: http://forums.alfresco.com/en/viewtopic.php?f=36&t=19713

Hope this helps.