J
Jason
I have a web form that will accept XML as input whose contents need to be
namespaced, and inserted into an XML document with a different namespace.
I need to take this:
Lorem ipsum dolor sit amet, consectetuer <a href="http://www.example.com"
title="etc" rel="whatever">Link Here</a> adipiscing elit. Vivamus molestie
dolor ultrices leo.
And stick it into this:
<root xmlns="http://some/default/ns"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<a>a</a>
<b>b</b>
<content>Lorem ipsum dolor sit amet, consectetuer <xhtml:a
href="http://www.example.com" title="etc" rel="whatever">Link Here</xhtml:a>
adipiscing elit. Vivamus molestie dolor ultrices leo.</content>
</root>
The form is being processed client side and the parent XML document is being
generated completely by Javascript using W3C XML DOM (need only work in
Firefox). The XML document is then POSTed to a PHP script that is doing
some additional processing to the xml document with SimpleXML and DOM.
Currently, the form contents are being added to the xml document and the xml
fragments are entity escaped. Any and all suggestions are welcome. Any
method of solution is acceptable (JavaScript, PHP, or XSLT, whatever works).
Just keep in mind the form contents must be namespaced differently from the
parent document namespace.
Thank you.
J.K
namespaced, and inserted into an XML document with a different namespace.
I need to take this:
Lorem ipsum dolor sit amet, consectetuer <a href="http://www.example.com"
title="etc" rel="whatever">Link Here</a> adipiscing elit. Vivamus molestie
dolor ultrices leo.
And stick it into this:
<root xmlns="http://some/default/ns"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<a>a</a>
<b>b</b>
<content>Lorem ipsum dolor sit amet, consectetuer <xhtml:a
href="http://www.example.com" title="etc" rel="whatever">Link Here</xhtml:a>
adipiscing elit. Vivamus molestie dolor ultrices leo.</content>
</root>
The form is being processed client side and the parent XML document is being
generated completely by Javascript using W3C XML DOM (need only work in
Firefox). The XML document is then POSTed to a PHP script that is doing
some additional processing to the xml document with SimpleXML and DOM.
Currently, the form contents are being added to the xml document and the xml
fragments are entity escaped. Any and all suggestions are welcome. Any
method of solution is acceptable (JavaScript, PHP, or XSLT, whatever works).
Just keep in mind the form contents must be namespaced differently from the
parent document namespace.
Thank you.
J.K