Created
November 9, 2010 01:11
-
-
Save ebruchez/668562 to your computer and use it in GitHub Desktop.
Output indented XML from XML in instances
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <xh:html xmlns:xf="http://www.w3.org/2002/xforms" | |
| xmlns:xh="http://www.w3.org/1999/xhtml" | |
| xmlns:xxf="http://orbeon.org/oxf/xml/xforms"> | |
| <xh:head> | |
| <xh:style type="text/css"> | |
| .output1, .output2 { white-space: pre-line; font-family: monospace } | |
| </xh:style> | |
| <xf:model> | |
| <xf:instance><foo> | |
| <bar>Gaga</bar> | |
| </foo></xf:instance> | |
| <xf:instance id="serialized"> | |
| <instance><foo> | |
| <bar>Gaga</bar> | |
| </foo></instance> | |
| </xf:instance> | |
| </xf:model> | |
| </xh:head> | |
| <xh:body> | |
| <xh:h2>As is</xh:h2> | |
| <xf:output mediatype="text/html" class="output1" | |
| value="replace(replace(replace(replace(xxf:serialize(., 'xml'), | |
| '&', '&amp;'), '<', '&lt;'), '
', '<br>'), ' ', ' ')"/> | |
| <xh:h2>Serialized</xh:h2> | |
| <xf:output mediatype="text/html" class="output1" | |
| value="replace(replace(replace(replace(instance('serialized'), | |
| '&', '&amp;'), '<', '&lt;'), '
', '<br>'), ' ', ' ')"/> | |
| </xh:body> | |
| </xh:html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment