This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Bad schemas
Thanks for your reply. Sorry to get back to you so long after the
fact. You've helped out quite a bit.
----- Original Message -----
From: "J.Pietschmann" <j3322ptm@yahoo.de>
To: <xsl-list@lists.mulberrytech.com>
Sent: Saturday, July 27, 2002 12:54 AM
Subject: Re: [xsl] Bad schemas
> Jeff Shevlen wrote:
> > Hi,
> >
> > Can anyone shed some light on why Xalan parses an XML doc with no
> > schema no namespace (skills)differently than the identical doc
> > (skills2), with a schema (that is not validating properly yet),
and a
> > namespace?
>
> This is a FAQ. The XPath expressions and template match
> expressions need an explicit namespace prefix, even if
> your sourtce XML uses the default namespace and therefore
> no namespace prefix.
>
> Try
>
> <?xml version = "1.0" encoding = "UTF-8"?>
> <xsl:stylesheet version = "1.0"
> xmlns:xsl = "http://www.w3.org/1999/XSL/Transform"
> xmlns:skills = "http://www.abc.com/skills">
>
> <xsl:output method = "xml" indent = "yes"/>
>
> <xsl:template match = "//skills:related_skill">
> <xsl:element name = "test">
> <xsl:text>XXXX </xsl:text>
> <xsl:attribute name = "skill_IDREF">
> <xsl:value-of select = "@skills:skill_IDREF"/>
> </xsl:attribute>
> </xsl:element>
> </xsl:template>
>
> BTW regarding the template above:
> 1. You can write it much shorter
> 2. It probably wont work, because you add the text child
> before the attribute.
> Try
> <xsl:template match = "//skills:related_skill">
> <test skill_IDREF="{@skills:skill_IDREF}">
> <xsl:text>XXXX </xsl:text>
> </test>
> </xsl:template>
> instead.
>
> Note that the "test" element is in the default namespace, not
> in the skills namespace.
>
> J.Pietschmann
>
>
> XSL-List info and archive:
http://www.mulberrytech.com/xsl/xsl-list
>
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list