[oXygen-user] XSLT coping xsi:schemaLocation?

George Cristian Bina
Thu Aug 9 08:51:45 CDT 2007


Hi Thimothy,

There is nothing special about the xsi:schemaLocation attribute in XSLT. 
You can copy that to the output as you copy any other attribute. For 
instance the following stylesheet that contains only the recursive copy 
template applied on itself passes through the xsi:schemaLocation 
attribute defined on the stylesheet element:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
version="1.0"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://www.w3.org/1999/XSL/Transform xslt.xsd">

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

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina - http://aboutxml.blogspot.com/
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


Timothy Reaves wrote:
>      O.K., I think I'm down to the last issue.  When I run my transform,
> my root elements xsi:schemaLocation attribute is not copied over
> however.  As I need to process the root elements children, I have to
> use copy.
> 
>      I tried  using the same technique I use for other attributes, but I
> can't specify an attribute name with xsi: in the name.
> 
>      Anyone know how to get the location to copy over? I still need it in
> place to validate the transformed element.  I'd even settle for being
> able to hard-code the value in the XSL file.
> 
> 
>      Thanks.
> 
> _______________________________________________
> oXygen-user mailing list
> 
> http://www.oxygenxml.com/mailman/listinfo/oxygen-user



More information about the oXygen-user mailing list