Embedding xsl in a URL...is this possible??
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 1
- Joined: Tue May 10, 2005 10:07 pm
- Location: London
Embedding xsl in a URL...is this possible??
Hello everyone,
Sorry in advance for being a bit of a newbie, but I'm just trying to include a bit of data into a url in an xsl stylesheet, and so far my guesswork has only produced the following (which doesn't work)...
I've tried searching everywhere for the answer to this but perhaps I've not been searching under the right terms.
Does anyone out there know the correct way for me to include the latitude and longitude into the above URL?
If the answer's yes then please please please help me out! I'd be extremely grateful!
Yours hopefully,
Betty
Sorry in advance for being a bit of a newbie, but I'm just trying to include a bit of data into a url in an xsl stylesheet, and so far my guesswork has only produced the following (which doesn't work)...
Code: Select all
<img>
<xsl:attribute name="src">
<xsl:text>http://uk.multimap.com/clients/gif.cgi?client=activeh&scale=200000&width=215&height=215&lon=</xsl:text>
<xsl:value-of select="geoDataCodes/longitude">
<xsl:text>&lat=</xsl:text>
<xsl:value-of select="geoDataCodes/latitude">
</xsl:attribute>
</img>
Does anyone out there know the correct way for me to include the latitude and longitude into the above URL?
If the answer's yes then please please please help me out! I'd be extremely grateful!
Yours hopefully,
Betty
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Correct approach
Hello, Betty
I changed the xsl snippet that you provided to the following:
Notice that instead of <img> you should use <xsl:element name= "img"> as it allows you to set the attribute value of the tag.
Also, all '&' characters are escaped to '&' so that the XML file is valid.
Regards, Radu.
I changed the xsl snippet that you provided to the following:
Code: Select all
<xsl:element name="img" >
<xsl:attribute name="src">
<xsl:text>http://uk.multimap.com/clients/gif.cgi?client=activeh&scale=200000&width=215&height=215&lon=</xsl:text>
<xsl:value-of select="geoDataCodes/longitude"/>
<xsl:text>&lat=</xsl:text>
<xsl:value-of select="geoDataCodes/latitude"/>
</xsl:attribute>
</xsl:element>
Also, all '&' characters are escaped to '&' so that the XML file is valid.
Regards, Radu.
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service