File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes Xalan to add element Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Xalan to add element" Watch "Xalan to add element" New topic
Author

Xalan to add element

Raghunath Nandyala
Ranch Hand

Joined: Jan 24, 2006
Posts: 64
Hi

Im adding <error-page><error-code>300</error-cede><location>/M.jsp</location></error-page> to many web.xml files using xsl
Im having one xsl and input web.xml files

Im adding it by using

<xml:template match="@*|node()"/>
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
<xml:template>


<xml:template match="@*|node()"/>
<xsl:copy>
<error-page><error-code>300</error-cede><location>/M.jsp</location></error-page>

<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
<xml:template>

im the output xml, it it is filling error-page to out.xml,

but it is adding like

<error-page xmlns:fo="http://www.w3.org/1999/XSL/Format">..</error-page>

i dont need xmlns:fo="http://www.w3.org/1999/XSL/Format

Please help me ?

Raghunath N


SCBCD,SCWCD,SCJP
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18152
    
    8

What problem is that extra namespace declaration causing?
Raghunath Nandyala
Ranch Hand

Joined: Jan 24, 2006
Posts: 64
Yes Paul,It wont give any problem, but why it is generating it,What is the need of name space defining over there,I'm eager to know this.

Thanks
Raghunath N
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Xalan to add element
 
Similar Threads
to EXACT Dublicate an xml file[xml->xml] via Java TransformerFactory classes and XSTL well I do not
Preserve comments in the XSL
[XSLT] remove a particular node
Need help with XSLT, modifying XML config files.
use XSLT to copy attribute/element and generate element