[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Inserting XML into stylesheet using copy-of

Subject: Re: Inserting XML into stylesheet using copy-of
From: Hermann Stamm-Wilbrandt <STAMMW@xxxxxxxxxx>
Date: Wed, 27 Jan 2010 10:32:10 +0100
Re:  Inserting XML into stylesheet using copy-of
For me this works, you may want to check your URL:

[html]$ cat s1h.xsl
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
  <xsl:copy-of select="document('http://127.0.0.1/s1.xml')/here"/>
</xsl:template>

</xsl:stylesheet>
[html]$ xsltproc s1h.xsl some.xml
<?xml version="1.0"?>
<here>hello</here>
[html]$

And accessing that stylesheet from within a browser
(http://127.0.0.1/s2.xml) works too:
[html]$ cat s2.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="http://127.0.0.1/s1h.xsl"?>
<xml/>
[html]$



Mit besten Gruessen / Best wishes,

Hermann Stamm-Wilbrandt
Developer, XML Compiler, L3
WebSphere DataPower SOA Appliances
----------------------------------------------------------------------
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschaeftsfuehrung: Dirk Wittkopp
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294


                                                                           
             Rob Belics                                                    
             <rob_belics@chart                                             
             er.net>                                                    To 
                                       xsl-list@xxxxxxxxxxxxxxxxxxxxxx     
             01/27/2010 04:48                                           cc 
             AM                                                            
                                                                   Subject 
                                        Inserting XML into stylesheet 
             Please respond to         using copy-of                       
             xsl-list@xxxxxxxx                                             
              lberrytech.com                                               
                                                                           
                                                                           
                                                                           
                                                                           




When I use a local file, I can insert an XML file into my xslt
stylesheet doing this:
<xsl:copy-of select="document('s1.xml')"/>

So I put s1.xml on my personal site:
<xsl:copy-of select="document('http://mysite.com/xml/s1.xml')"/>
but it fails with "XML Parsing Error: no element found"

s1.xml only contains <here>hello</here> and I can access it via a
browser. What am I doing wrong?

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.