Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Help! How Import XML Using xsl:copy-of & document()?

From: "Joe Fawcett" <joefawcett@---------.------>
To: NULL
Date: 2/2/2006 9:07:00 AM
<pmbarnes@g...> wrote in message 
news:1138855015.046838.154100@g......
>I am pretty new to XSL. I'm trying to import the contents of a
> well-formed XML document into an XSL file during processing. Everything
> I've read on this says that the following should work:
>
> <xsl:copy-of select="document('header.xml')"/>
>
> But nothing happens. The Row elements in header.xml never get imported.
> I don't get any processing errors. I've also tried in the select
> attribute appending "/node()" and "/Header/node()" and a few other
> things.
>
> Here's the contents of header.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <Header xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
> xmlns:x="urn:schemas-microsoft-com:office:excel">
> <Row>
> <Cell ss:StyleID="s85"><Data ss:Type="String">Changes are not
> pushed back to InfoPath! </Data></Cell>
> <Cell ss:StyleID="s84"/>
> <Cell ss:StyleID="s84"/>
> </Row>
> <Row ss:AutoFitHeight="0" ss:Height="35.25">
> <Cell ss:StyleID="s48"><ss:Data ss:Type="String"
> xmlns="http://www.w3.org/TR/REC-html40"><B>CMS</B><Font> ::
> Hardware Quote</Font></ss:Data></Cell>
> </Row>
> </Header>
>
Try a simple stylesheet with just
<xsl:template match="/">
  <<xsl:copy-of select="document('header.xml')"/>
</xsl:template>

This assumes that both header.xml and the stylesheet are loaded from files 
in the same folder.

The other thing is which platform are you using?
If you're using .NET or the later Msxml versions then you'll need to set 
permisssions to allow use of the document function


-- 

Joe Fawcett (MVP - XML)

https://mvp.support.microsoft.com/profile=8AA9D5F5-E1C2-44C7-BCE8-8741D22D17A5 




transparent
Print
Mail
Like It
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.

.
.

transparent

transparent