468,321 Members | 1,783 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,321 developers. It's quick & easy.

including images with enclosure_url

Hi there,

I am trying to include pictures into an item. Somehow I am using wrong code as
it does not work. I am pretty new to XML.

Here is my try:

<img>
<xsl:attribute name="src">
<xsl:value-of select="enclosure_url" />
</xsl:attribute>
</img>

Can anybody help?

Thank you in advance, Merlin
Mar 30 '06 #1
6 1335

Merlin wrote:
I am trying to include pictures into an item. Somehow I am using wrong code as
it does not work.


Looks fine to me. I suspect that the XPath in the select isn't finding
what you'd expect it to find. We'd need to see the source XML before
saying any more.

Mar 30 '06 #2


Merlin wrote:
I am trying to include pictures into an item. Somehow I am using wrong
code as it does not work. I am pretty new to XML.

Here is my try:

<img>
<xsl:attribute name="src">
<xsl:value-of select="enclosure_url" />

^^^^^^^^^^^^^

What do you think 'enclosure_url' is? Is that the name of an element in
your input XML?

If you have problems with an XSLT stylesheet then show the relevant
parts of the input XML and enough context of the stylesheet. If
enclosure_url is an element name then we can only say whether the above
makes sense if we know the input XML and the current context node.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Mar 30 '06 #3
Martin Honnen schrieb:


Merlin wrote:
I am trying to include pictures into an item. Somehow I am using wrong
code as it does not work. I am pretty new to XML.

Here is my try:

<img>
<xsl:attribute name="src">
<xsl:value-of select="enclosure_url" />

^^^^^^^^^^^^^

What do you think 'enclosure_url' is? Is that the name of an element in
your input XML?

If you have problems with an XSLT stylesheet then show the relevant
parts of the input XML and enough context of the stylesheet. If
enclosure_url is an element name then we can only say whether the above
makes sense if we know the input XML and the current context node.

Hi there,

I am using following XML:

<item>
<enclosure url="http://test/data/adpix/thumb/" length="1000"
type="image/jpeg" />
</item>

Then I do with XSL:

<img>
<xsl:attribute name="src">
<xsl:value-of select="enclosure_url"/>
</xsl:attribute>
</img>

Can anybody see the error?

Thank you for your help,

Merlin
Mar 30 '06 #4
Merlin wrote:
Hi there,

I am using following XML:

<item>
<enclosure url="http://test/data/adpix/thumb/" length="1000"
type="image/jpeg" />
</item>

Then I do with XSL:

<img>
<xsl:attribute name="src">
<xsl:value-of select="enclosure_url"/>
</xsl:attribute>
</img>

Can anybody see the error?


Yes, there is no element called "enclosure_url".
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Mar 30 '06 #5
In article <49************@individual.net>,
Merlin <ng*****@fastmail.fm> wrote:
I am using following XML:

<item>
<enclosure url="http://test/data/adpix/thumb/" length="1000"
type="image/jpeg" />
</item>

Then I do with XSL:

<img>
<xsl:attribute name="src">
<xsl:value-of select="enclosure_url"/>
</xsl:attribute>
</img>

Can anybody see the error?


Yes. Your XSL is selecting an element called "enclosure_url" and there
isn't one in your document. There's one called "enclosure" and it
has an attribute "url". Did you mean to select "enclosure/@url"?

-- Richard
Mar 30 '06 #6


Richard Tobin schrieb:
In article <49************@individual.net>,
Merlin <ng*****@fastmail.fm> wrote:
I am using following XML:

<item>
<enclosure url="http://test/data/adpix/thumb/" length="1000"
type="image/jpeg" />
</item>

Then I do with XSL:

<img>
<xsl:attribute name="src">
<xsl:value-of select="enclosure_url"/>
</xsl:attribute>
</img>

Can anybody see the error?


Yes. Your XSL is selecting an element called "enclosure_url" and there
isn't one in your document. There's one called "enclosure" and it
has an attribute "url". Did you mean to select "enclosure/@url"?

-- Richard

thank you Richard. This was what I needed.

Regards, Merlin
Mar 31 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Peter Taurins | last post: by
1 post views Thread by Jim Mesara | last post: by
2 posts views Thread by jordan | last post: by
5 posts views Thread by Bijoy Naick | last post: by
reply views Thread by gerard.buskermolen | last post: by
10 posts views Thread by Robert Huff | last post: by
reply views Thread by =?Utf-8?B?U2hhbQ==?= | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by howard w | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.