#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2011
    Posts
    2
    Rep Power
    0

    Newbie xml/xsl question


    i have this xml file, and i am pulling certain information out of it via an xsl file, like this.

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    	<xsl:output method="text" encoding="utf-8"/>
    <xsl:param name="sep" select="'&amp;&amp;#35;09;' " />
    	<xsl:param name="eol" select="'&amp;&amp;#35;10;' " />
    	<xsl:template match="Items">
    
        <xsl:for-each select="Item">
    			<xsl:value-of select="ItemKey"/>
    			<xsl:value-of select="$sep"/>
    			<xsl:value-of select="Name/English"/>
    and about 30 more lines
    			<xsl:value-of select="$eol"/>
    		</xsl:for-each>
    	</xsl:template>
    </xsl:stylesheet>
    and it transforms the information just like i want but i cant figure out how to wrap ItemKey and Name/English ( all the node's ) in '' like this 'Name/English' for the transformed text.
    how would i go about this?
    and thanks in-advance for any help on this question.
    Last edited by requinix; July 19th, 2011 at 05:35 PM.
  2. #2
  3. Transforming Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,143
    Rep Power
    9398
    (I "fixed" the XSLT. The problem is the forum software, and the trick to get entities to display properly is so confusing I don't know if I can explain it well enough; Edit or Reply to the post to see what I mean.)

    All you need is to add quotes? How about
    Code:
    <xsl:text>'</xsl:text>
    <xsl:value-of select="ItemKey" />
    <xsl:text>'</xsl:text>
    Last edited by requinix; July 19th, 2011 at 05:42 PM.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2011
    Posts
    2
    Rep Power
    0
    thank you for the fast reply back to this question.

IMN logo majestic logo threadwatch logo seochat tools logo