Re: help request from novice

Please ask XSLT specific questions at,
http://www.mulberrytech.com/xsl/xsl-list/index.html. The discussions
there are more focused towards XSLT.

But I'll try to answer your question.

My question to you is - which XSLT processor are you using? I cannot
find way to use XInclude functionality with either Xalan-J or Saxon.

But nonetheless, I can transform temp.xml with rdfcat.xsl. And I get
the error you are saying. So, definetely there is a problem with the
stylesheet, rdfcat.xsl.

The problem is with the template, <xsl:template
match="*[@rdf:about]">. You cannot have <xsl:apply-templates
select="@* at the position, where it is now.

Either you rewrite this template as,
<xsl:template match="*[@rdf:about]">
   <rdf:Description rdf:about="{@rdf:about}">
      <rdf:type>
         <owl:Class rdf:about="{namespace-uri(.)}{local-name()}"/>
      </rdf:type>
      <xsl:apply-templates select="node()"/>
   </rdf:Description>
</xsl:template>

or,
<xsl:template match="*[@rdf:about]">
  <rdf:Description rdf:about="{@rdf:about}">
    <xsl:apply-templates select="@*" />
    <rdf:type>
      <owl:Class rdf:about="{namespace-uri(.)}{local-name()}"/>
    </rdf:type>
    <xsl:apply-templates select="node()"/>
   </rdf:Description>
</xsl:template>


On 4/13/07, catchope <annamalay@gmail.com> wrote:
>
> Hi,
>     I have been trying to combine an xml(rdfcat1.xml which includes
> temp.xml in my case) with xsl (rdfcat.xsl ) but am receiving the following
> runtime error in my xsl:
>
> Attribute nodes must be added before any child nodes to the element.
>
>
> <xsl:template match="@*|node()">
> <!-- ERROR POINTS TO THIS LINE--!>
>  <xsl:copy>
>  <xsl:apply-templates select="@*|node()"/>
>  </xsl:copy>
>  </xsl:template>
> I have attached my files.
>
>
>
> Please someone help me.
> Thanks
> Anand
>
> http://www.nabble.com/file/7858/rdfcat1.xml rdfcat1.xml
> http://www.nabble.com/file/7859/rdfcat.xsl rdfcat.xsl
> http://www.nabble.com/file/7860/temp.xml temp.xml


-- 
Regards,
Mukul Gandhi

Received on Sunday, 15 April 2007 15:02:37 UTC