Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
 

Go Back   XSL - XML - RSS Forums > XSLForum: Main > XSL Coding General

Tags:



Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-24-2008, 06:36 PM
CK
 
Posts: n/a

Default xslt help - what am I doing wrong?



<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match='/'>

<xsl:apply-templates select='ArrayOfString'></xsl:apply-templates>

</xsl:template>

<xsl:template match='ArrayOfString'>

<xsl:apply-templates select='string'></xsl:apply-templates>

</xsl:template>

<xsl:template match='string'>

<span class='roleClass'><xsl:value-of select="."/></span>

<br/>

</xsl:template>

</xsl:stylesheet>



I try to use this xslt with the following XML and I get an error. Internet
Explorer says the stylesheet is empty or doesn't contain a document element.
Any ideas? ****This XML is returned from a web service.

<?xml version="1.0"?>

<ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/">

<string>blah blah blah</string>

<string>blah blah blah</string>

<string>blah blah blah</string>

<string>blah blah blah</string>

<string>blah blah blah</string>

<string>blah blah blah</string>

</ArrayOfString>


Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-24-2008, 07:57 PM
Joe Fawcett
 
Posts: n/a

Default Re: xslt help - what am I doing wrong?



"CK" <c_kettenbach@hotmail.com> wrote in message
news:rN2ik.31100$co7.21723@nlpi066.nbdc.sbc.com...
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>
> <xsl:template match='/'>
>
> <xsl:apply-templates select='ArrayOfString'></xsl:apply-templates>
>
> </xsl:template>
>
> <xsl:template match='ArrayOfString'>
>
> <xsl:apply-templates select='string'></xsl:apply-templates>
>
> </xsl:template>
>
> <xsl:template match='string'>
>
> <span class='roleClass'><xsl:value-of select="."/></span>
>
> <br/>
>
> </xsl:template>
>
> </xsl:stylesheet>
>
>
>
> I try to use this xslt with the following XML and I get an error. Internet
> Explorer says the stylesheet is empty or doesn't contain a document
> element. Any ideas? ****This XML is returned from a web service.
>
> <?xml version="1.0"?>
>
> <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/">
>
> <string>blah blah blah</string>
>
> <string>blah blah blah</string>
>
> <string>blah blah blah</string>
>
> <string>blah blah blah</string>
>
> <string>blah blah blah</string>
>
> <string>blah blah blah</string>
>
> </ArrayOfString>
>
>

Suggest you look at http://www.dpawson.co.uk/xsl/sect2/N5536.html especially
13 & 23.
However the error you're getting suggests that that's not the problem, are
you sure it's the stylesheet? Is this related to a post on SoapClient I
responded to the other day? In that case you're not getting an XML document
but an array.

--

Joe Fawcett (MVP - XML)
http://joe.fawcett.name

Reply With Quote
  #3 (permalink)  
Old 10-20-2008, 03:45 PM
namca
 
Posts: n/a

Default Re: xslt help - what am I doing wrong?



"CK" <c_kettenbach@hotmail.com> wrote in message
news:rN2ik.31100$co7.21723@nlpi066.nbdc.sbc.com...
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>
> <xsl:template match='/'>
>
> <xsl:apply-templates select='ArrayOfString'></xsl:apply-templates>
>
> </xsl:template>
>
> <xsl:template match='ArrayOfString'>
>
> <xsl:apply-templates select='string'></xsl:apply-templates>
>
> </xsl:template>
>
> <xsl:template match='string'>
>
> <span class='roleClass'><xsl:value-of select="."/></span>
>
> <br/>
>
> </xsl:template>
>
> </xsl:stylesheet>
>
>
>
> I try to use this xslt with the following XML and I get an error. Internet
> Explorer says the stylesheet is empty or doesn't contain a document
> element. Any ideas? ****This XML is returned from a web service.
>
> <?xml version="1.0"?>
>
> <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/">
>
> <string>blah blah blah</string>
>
> <string>blah blah blah</string>
>
> <string>blah blah blah</string>
>
> <string>blah blah blah</string>
>
> <string>blah blah blah</string>
>
> <string>blah blah blah</string>
>
> </ArrayOfString>
>
>
>

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Contact Us -|- XSL - XML - RSS Forums -|- Archive -|- Top -|-Rules/Disclaimer-|-Help/Support -|-Advertise
© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
All times are GMT. The time now is 01:22 PM.
Style Developed by Epic Designz