cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in XSLT mapping

0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

prateek
Active Contributor
0 Kudos

Are u sure u importing it under the "Imported Archives"

Regards,

Prateek

0 Kudos

!!!

Edited by: Harpreet Daphu on Feb 6, 2008 10:44 AM

0 Kudos

Sorry i had imported it in External Defination..

But it is not getting upload in Imported Archive , altough it is a .ZIP file

prateek
Active Contributor
0 Kudos

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

0 Kudos

Still m unable to Upload the XSLT file

0 Kudos

Prateek It's done..!!

Thanks for ur hlp.!!

prateek
Active Contributor
0 Kudos

Ur welcome

Please share the final solution.

Regards,

Prateek