Altova Mailing List Archives


RE: [xsl] Merging multiple SVGs using XSLT

From: "Michael Kay" <mhk@--------->
To:
Date: 11/7/2003 1:10:00 PM
> 
> Following is the XSL code I am using...

I can't tell you what you should be doing (it's too late at night to try
and understand your problem clearly) but I can tell you a little about
what you're doing wrong.
> 
> <xsl:stylesheet version="1.0" 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> 
> 
> 
> 	<xsl:template match="/">
> 		<svg xmlns="http://www.w3.org/2000/svg"
> xmlns:svg="http://www.w3c.org/2000/svg" width="1656" 
> height="2088" viewBox="0 0 1656 2088"> 

    <xsl:copy-of select="*[..]"/>

This xsl:copy-of instruction copies all children of the root node that
have a parent. Of course all children of the root have a parent, so the
predicate does nothing. If you left out the predicate, you would copy
the whole source document, without making any changes to it. That can't
really be what you want.

> 		<xsl:for-each select="/">

This selects the root node of the tree and iterates over it. There's no
point in iterating over a node-set containing a single node (and it's
only selecting the node that's already the context node for this
template anyway).
> 
> 		
> 			
> 	        		<xsl:if test="position()=last()">

If you're iterating over one node, then that node will always be the
last...

> 					<svg 
> xmlns="http://www.w3.org/2000/svg"
> xmlns:svg="http://www.w3c.org/2000/svg" x="456"
> y="420" width="748" height="224">

Both these namespaces are already declared, why do you need to declare
them again?

> 		        	   	<xsl:copy-of 
> select="document('http://10.96.10.20/servlet/ImageReaderByNIDQ
> ?nacid=119476&amp;filetype=f')"/>
> 					</svg>
> 
> 					<svg 
> xmlns="http://www.w3.org/2000/svg"
> xmlns:svg="http://www.w3c.org/2000/svg" x="396"
> y="756" width="864" height="540">
> 		        	   	<xsl:copy-of 
> select="document('http://10.96.10.20/servlet/ImageReaderByNIDQ
> ?nacid=119480&amp;filetype=f')"/>
> 					</svg>
> 		        	</xsl:if>
> 			
> 		
> 		</xsl:for-each>
> 		</svg>
> 	</xsl:template> 
> 	
> 	
> </xsl:stylesheet>
> 

I'm sorry my comments aren't more constructive but I hope they help you
see what you're doing wrong.

Michael Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.