473,378 Members | 1,346 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

XSLT help. This hurts.

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
Jul 20 '05 #1
4 2093
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.
"Brett conklin" <bc******@sentius.com> wrote in message
news:e1**************************@posting.google.c om...
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

Jul 20 '05 #2
> So how do I grab "/wed/dd/Cwebwire-bac_gen.6898.html" from <FIELD
NAME="urls">
string(/*/*/FIELD[@NAME='urls'])
=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

"Brett conklin" <bc******@sentius.com> wrote in message
news:e1**************************@posting.google.c om... 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

Jul 20 '05 #3
it's _supposed_ to hurt - Welcome to XSLT ;-))

"Brett conklin" <bc******@sentius.com> wrote in message
news:e1**************************@posting.google.c om...
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

Jul 20 '05 #4
I have noticed. Man this was much easier in Perl. But I will prevail.

"Andy Fish" <aj****@blueyonder.co.uk> wrote in message news:<yX*********************@news-text.cableinet.net>...
it's _supposed_ to hurt - Welcome to XSLT ;-))

"Brett conklin" <bc******@sentius.com> wrote in message
news:e1**************************@posting.google.c om...
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

Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Pete | last post by:
I am just getting to grips with XML and I was wondering if you could help me with something that no-one seems able or willing to help with.. I have an XSLT file which should be transforming a...
1
by: Victor | last post by:
Hi, this might sound silly but I cannot figure out how to incorporate some XML of employees into some XML of a company to give new XML containing them all. For example, this is the company now ...
12
by: gipsy boy | last post by:
Hello, I have sort of a big problem. I would really appreciate any help you could give me. I made a web service in C++ that throws XML to the client (browser). But, the XSLT transormation...
5
by: Fred | last post by:
Not much expertise on XSLT and trying to understand it's uses when creating apps in VS.NET? If I wanted flexibility on the UI (View aspect of M.V.C.): - How does it compare with creating...
4
by: Moogy | last post by:
I'm pulling my hair out here. First, I'm new to XML, so that doesn't help, but none of this makes any sense to me. All I'm trying to do is take a simple source XML file and translate it with an...
5
by: cody | last post by:
Iam using Beta2 of VS2005 and getting the error "Error 4 'format-dateTime()' is an unknown XSLT function" at the following line: <xsl:value-of select="format-dateTime($pubDate,' : ')" /> ...
7
by: Harolds | last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005 the pmID is evaluated to "" instead of what the value is set to: .... xmlItems.Document = pmXML // Add the pmID...
18
by: yinglcs | last post by:
Hi, I have a newbie XSLT question. I have the following xml, and I would like to find out the children of feature element in each 'features' element. i.e. for each <featuresI would like to...
15
by: Jeff Uchtman | last post by:
Can I draw from 2 XML sources, the structure is exactly the same execpt for data contained into 1 xslt using math to add some structrure, and displaying others as node 1 and node 2? This data is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.