on 02-06-2008 8:50 AM
Hello,
I am working on XSLT mapping, where i am trying to add similar values but when i upload the .xsl file i get a Java Null pointer Error, this is the error :-
*Cause: Unable to recognize the loaded document as valid XSD*
*Error when parsing XSD document com.sap.aii.utilxi.xsd.api.XsdException: A schema must start with the tag <schema> that belongs to "http://www.w3.org/2001/XMLSchema" namespace*
This is the complete XSLT file that m trying to upload.
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<!-- Build a key to group item by itemDescription -->
<xsl:key name="itemDescription" match="salesOrder/item" use="itemDescription"/>
<xsl:template match="/">
<salesOrder>
<!-- iterate on each group -->
<xsl:for-each select="salesOrder/item[generate-id(.) = generate-id(key('itemDescription', itemDescription)[1]) ]">
<xsl:variable name="group" select="key('itemDescription', itemDescription)"/>
<xsl:variable name="itemDescription">
<xsl:value-of select="itemDescription"/>
</xsl:variable>
<xsl:variable name="itemRetailPrice">
<xsl:value-of select="sum($group/itemRetailPrice)"/>
</xsl:variable>
<xsl:variable name="itemSalePrice">
<xsl:value-of select="sum($group/itemSalePrice)"/>
</xsl:variable>
<!-- Generate the final XML file -->
<item>
<itemDescription>
<xsl:value-of select="$itemDescription"/>
</itemDescription>
<itemRetailPrice>
<xsl:value-of select="$itemRetailPrice"/>
</itemRetailPrice>
<itemSalePrice>
<xsl:value-of select="$itemSalePrice"/>
</itemSalePrice>
</item>
</xsl:for-each>
</salesOrder>
</xsl:template>
</xsl:stylesheet>
Thanks !!
Harpreet
Are u sure u importing it under the "Imported Archives"
Regards,
Prateek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The message was 1 related to some errors at External definition. That y i asked that question.
Are u getting any other error now?
This looks distorted after posting
Now for ur xsl file
Instead of
<xsl:for-each select="salesOrder/item[generate-id(.) = generate-id(key('itemDescription', itemDescription)1])">
Use
<xsl:for-each select="salesOrder/item[generate-id(.) = generate-id(key('itemDescription', itemDescription)[1]) ]">Regards,
Prateek
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.