XSLT help. This hurts.

B

Brett conklin

I have an xml document that I am trying to transform into HTML. This
sounds straigt forward but the xml uses an format that I don't know
how to xslt. Here is the format.

<RESULTSET>
<HIT>
<FIELD NAME="contenttype">text/html</FIELD>
<FIELD NAME="language">en</FIELD>
<FIELD NAME="charset">iso-8859-1</FIELD>
<FIELD NAME="urls">/wed/dd/Cwebwire-bac_gen.6898.html</FIELD>
</HIT>
<HIT>
</HIT>
</RESULTSET>

I think this is poorly written XML but I have no choice. I need to
get the data from the entity <FIELD> but I only need specific ones.
For example I need to grab the data from <FIELD NAME="urls"> but I
don't know how to address it specifically. Now you ask why did this
application decide that using the same xml entity over and over again,
I could not tell you. A <URL> entity would have worked just fine.
Thanks ahead of time for your help.

So how do I grab "/wed/dd/Cwebwire-bac_gen.6898.html" from <FIELD
NAME="urls"> I have already tried <xsl:value-of select="@headings"/>.
Any help would be greatly appreciated.

Brett
 
K

Kimanzi Mati

RESULTSET/HIT/FIELD/[@NAME='urls'] will get you the FIELD element you are
looking for. To get the text contained in it you can use the text()
function.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top