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

Newbie cannot find syntax error in attribute select

Subject: Newbie cannot find syntax error in attribute select
From: thehulk@xxxxxxxxxxx
Date: Wed, 16 Feb 2011 03:14:14 +0000 (UTC)
 Newbie cannot find syntax error in attribute select
Hello,

I am trying to transform "Account" elements into "Contract" elements which contain some of the data in the "Account" element. I want to make the Sub-Id into an attribute of the Contract, taking it from an attribute of an element within the Account element. (I also get the Org-Id from one of the "Characteristic" elements within the Account, which works fine. I thought that would be the hard part!)

I am using Eclipse 3.6.1 and performing the transform with the "Run" menu. My processor is the "jaxp" plugin.

My (bad) template is:

<xsl:template match="Account_or_Subaccount">
  <xsl:element name="Contract">
    <xsl:attribute name="Sub_ID">
      <xsl:value-of select="./Subscriber_Info@Sub_Id" />
    </xsl:attribute>
    <xsl:attribute name="Org_ID">
      <xsl:value-of select="./Characteristic[@Display_Lable=&quot;Organization ID&quot;]" />
    </xsl:attribute>
  </xsl:element>
</xsl:template>

and when I run I get

16:15:09,165 INFO [main] Main - java.endorsed.dirs=C:\Program Files\Java\jre6\lib\endorsed
16:15:09,165 INFO [main] Main - launchFile: H:\Eclipse361\workspace1\.metadata\.plugins\org.eclipse.wst.xsl.jaxp.launching\launch\launch.xml
16:15:09,321 ERROR [main] JAXPSAXProcessorInvoker - Syntax error in './Subscriber_Info@Sub_Id'.
16:15:09,321 ERROR [main] JAXPSAXProcessorInvoker - Could not compile stylesheet
javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet

and a stack trace.

If I make just one mod, instead:

<xsl:value-of select="./Subscriber_Info[@Sub_Id]" />

Then I get output which dumps the subscriber info:

<Organization Org_ID="1496475" Sub_ID="&#10;&#10;Boersegasse 77&#10;Elevator 3/ Top Floor&#10;Vienna&#10;000&#10;AT&#10;A-1010&#10;&#10;"/>

Of course I want
<Organization Org_ID="1496475" Sub_ID="58605"/>

My source XML looks like this:
<Account>
<Subscriber_Info Name="Doe entt - CO" Sub_Id="58605" Prnt_Sub_Id="57262" >
<Subscriber_Address>
<Addr_Line1>Boersegasse 77</Addr_Line1>
<Addr_Line2>Elevator 3/ Top Floor</Addr_Line2>
<City>Oville</City>
<State_or_Province>000</State_or_Province>
<Country>AT</Country>
<Postal_Code>A-1010</Postal_Code>
</Subscriber_Address>
</Subscriber_Info>
<Characteristic Description="Organization ID" Display_Lable="Organization ID">1496475</Characteristic>
<Characteristic Description="Contract Id" Display_Lable="Contract ID">98852</Characteristic>
</Account>

If anybody can help it will be greatly appreciated and result in much good karma. Or, I can send chocolate. 

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.