Subject:Mapper Author:Eugene Kirin Date:07 Dec 2004 12:33 PM
Hello!
Please explain me..
When I mapping one schema to another. I get the next xslt:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="http://www.eastview.com/xmlns/guide">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<guide_books>
<xsl:apply-templates select="a:guide_books/a:book"/>
</guide_books>
</xsl:template>
<xsl:template match="a:book">
<meta>
<xsl:attribute name="book-id">
<xsl:value-of select="a:guide_books/a:book/a:meta/@book-id"/>
</xsl:attribute>
</meta>
</xsl:template>
</xsl:stylesheet>
Please pay your attention that here is 2 templates (match="/" and match="a:book").
In template that matches on root(/) I apply match for "a:guide_books/a:book" and here is all right.
But in "a:book" template is a ploblem in "xsl:value-of" instruction. The "a:guide_books/a:book/a:meta/@book-id" value of select attribute is wrong.
Because select begins from "a:guide_books/..." instead of "/a:guide_books/...". Missed root(/) How can I fix this?
Subject:Mapper Author:Eugene Kirin Date:08 Dec 2004 05:44 AM Originally Posted: 08 Dec 2004 04:19 AM
Yes, of course. I attached them. This schemas quite simple and differ from each other
only elements (meta and source) position. In the old schema "meta" element goes after "source" element.
In the new schema "meta" element goes before "source" element.