Subject:Copy an xml document including the elements prefixes Author:Dorian Dongmo Date:26 Jul 2007 09:14 AM
Hello helpful people,
I am using a JAXP application to modify the content of an xml document. The modifications are done using DOM in the java application, and in the end I am trying to output the result tree by binding the source tree to the following identity style sheet:
However, my style sheet leaves out all the prefixes of the source document and outputs the tag names without prefixes. for example, an element named <ibml:equity> in the source will appear as <equity> in the result. How do I copy the tag names prefixes such as "ibml" (all declared in namespaces in the source document) as well?
Subject:Copy an xml document including the elements prefixes Author:Jan Verhoek Date:26 Jul 2007 12:16 PM
Apart from the fact that your template could just look like:
<xsl:template match="*">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
I tried yours and it copied my namespaces into the result xml.
even if it's not clear to me which prefix you really want to redefine (the XML fragment you posted uses the default namespace for the FpML namespace, not for the ibml one)
Subject:Copy an xml document including the elements prefixes Author:Dorian Dongmo Date:27 Jul 2007 06:02 AM
Hi Alberto,
You can see the style sheet I am using, it was posted before. The problem I have is the elements prefixed with ibml come out without prefix, so for example <ibml:equity> comes out as <equity>. I want the unprefixed elements to stay unprefixed, and the prefixed ones to keep their prefix. How do I implement that in my style sheet?
Subject:Copy an xml document including the elements prefixes Author:(Deleted User) Date:27 Jul 2007 06:43 AM
Hi Dorian,
you posted the stylesheet, but you didn't post the input XML; also, the result XML is displayed only with the first tag, so we don't see the equity node you are referring to. If you need further assistance, please provide both the input and the result XML.
Now I am doing some modifications on the attributes and values of certain elements using DOM instructionx in JAXP. Finally, I bind the DOMsource file to the style sheet posted above just to output it identically in xml. And this is the output (all my DOM transformations are ok, but the "ibml" prefixes are missing in the ouput)
Now I am doing some modifications on the attributes and values of certain elements using DOM instructionx in JAXP. Finally, I bind the DOMsource file to the style sheet posted above just to output it identically in xml. And this is the output (all my DOM transformations are ok, but the "ibml" prefixes are missing in the ouput)
Now I am doing some modifications on the attributes and values of certain elements using DOM instructionx in JAXP. Finally, I bind the DOMsource file to the style sheet posted above just to output it identically in xml. And this is the output (all my DOM transformations are ok, but the "ibml" prefixes are missing in the ouput)
Now I am doing some modifications on the attributes and values of certain elements using DOM instructionx in JAXP. Finally, I bind the DOMsource file to the style sheet posted above just to output it identically in xml. And this is the output (all my DOM transformations are ok, but the "ibml" prefixes are missing in the ouput)
Subject:Copy an xml document including the elements prefixes Author:(Deleted User) Date:27 Jul 2007 09:36 AM
Hi Dorian,
the duplicate messages are usually generated when you press the 'refresh' button of your browser on the page that is generated after you inserted the post (as the browser sends the same POSTDATA informations used to generate the page); in any case, the author of the post can delete his own messages by clicking on the 'delete' action on top of it.
As for the namespace prefix problem, the problem is not in the original XML nor in the stylesheet (if you process the original file with the stylesheet, you get the ibml prefixes in the output), so the error lies in the JAXP code. If you don't want to post it in a public forum, you can send it to stylus-field-report@progress.com.