xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian A. Calmeyer" <christian.calme...@aschehoug.no>
Subject Re: xlink:href
Date Tue, 18 Apr 2000 07:31:23 GMT
Well. Yeah... I've already done that. I just couldn't get it to work at all w/o an explicit
namespace. I also tried to explicitly set the namespace in the xml source too, but without
any luck. Perhaps there is something missing from Xalan since XT works (and eXcelon Stylus
2.0 as well)?

I must thank you, Thomas, for taking the time testing, I'll have a try at XT to get my things
done.

Yours
Christian



----- Original Message ----- 
From: "Thomas B. Passin" <tpassin@mitretek.org>
To: <general@xml.apache.org>
Sent: Monday, April 17, 2000 5:23 PM
Subject: Re: xlink:href


> 
> Christian A. Calmeyer asked for help with an XSLT/Xerces problem
> (reproduced below)
> 
> 
> Christian, I couldn't get your example to work with XT either.  I
> discovered that
> 1) I had to include the xlink namespace declaration in the stylesheet,
> and
> 2) The real trouble was caused by the use of a default namespace. XT did
> not recognize the <image> tag when it was specified in the <xsl:template
> match=""> statement.
> 
> I got the stylesheet to work  when I changed the default namespace to
> use a prefix (I used "i").  Notice that I did not have to change the XML
> document, just the stylesheet.  It seems that XT needs to have some
> definite prefix or it can't match up namespaces.  I don't know if this
> is a bug or the correct behavior.
> 
> Why don't you try my version of your example - I know it works with XT.
> Here it is:
> 
> ----------- Source XML: -------------
> <document xmlns="http://xxxxx/"
> xmlns:xlink="http://www.w3.org/1999/xlink/">
> <image xlink:type="simple" xlink:href="xxx.jpg"/>
> </document>
> 
> ----------- Stylesheet: ---------
> <xsl:stylesheet
> xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'
> xmlns:i="http://xxxxx/"
> xmlns:xlink="http://www.w3.org/1999/xlink/">
> 
> <xsl:template match="/">
> <xsl:apply-templates/>
> </xsl:template>
> 
> <xsl:template match="i:image"> <!--Yes, this looks wrong but it
> works!-->
> <xsl:element name="img">
>    <xsl:attribute name="src">
>       <xsl:value-of select="@xlink:href"/>
>    </xsl:attribute>
> </xsl:element>
> </xsl:template>
> 
> </xsl:stylesheet>
> 
> 
> Would someone who understands xslt better than I please tell us if this
> is the behavior intended by the rec or not?
> 
> Regards,
> Tom Passin
> 
> ========================================================================
> ===
> I have difficulties mapping a 'xlink:href' attribute to HTML 'src'
> attribute (or 'href' for that matter),
> usingXerces-J 1.0.3 / Xalan 1.0.1.
> 
> The transformation looks like:
> 
> <img>
> <xsl:attribute name="src">
> <xsl:value-of select="@xlink:href"/>
> </xsl:attribute>
> </img>
> 
> The xml source is
> <image xlink:type="simple" xlink:href="xxx.jpg"/>
> 
> Namespaces are declared in the root element:
> <document xmlns="http://xxxxx/"
> xmlns:xlink="http://www.w3.org/1999/xlink/">
> 
> Using <img src="{@xlink:href}"> or any other combination won't work
> either. You must excuse my ignornance, but after browsing mailinglists
> and standards, I still can't a way around this problem (apart for
> skipping the namespace).
> 
> ========================================================================
> ================
> 
> 
> ---------------------------------------------------------------------
> In case of troubles, e-mail:     webmaster@xml.apache.org
> To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> For additional commands, e-mail: general-help@xml.apache.org
> 
> 


Mime
View raw message