473,320 Members | 1,884 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,320 software developers and data experts.

Extraction Of Attribute value

I have an xml document as shown (not mine but extracted from an
application):

<category defid="468808" name="Global Information Attributes"
versionid="6">
<attributeset attid="1" name="Global Information Attributes">
<attribute attid="3" name="Issue_Date"
type="-7">2003-09-30T00:00:00</attribute>
<attribute attid="4" name="Review_Date"
type="-7">2006-10-30T00:00:00</attribute>
</attributeset>
</category>
I need to write an XSL to extract the values of 10 the Issue_Date (In
this case = 2003-09-30T00:00:00) and Review_Date (In this case =
2006-10-30T00:00:00)

I wrote this in my xsl:

<xsl:value-of select="category/attributeset/attribute/@attid=4"/>

It did not give me the desired result. It gave me a value = true.

In addition how can I trim the date to show only "2003-09-30" for
example.

Thanks
Jul 20 '05 #1
5 2236
On 30 Sep 2004 03:01:55 -0700, AwanJohnie wrote:
<xsl:value-of select="category/attributeset/attribute/@attid=4"/>

IIRC it should be

<xsl:value-of select="category/attributeset/attribute[@attid=4]" />
Jul 20 '05 #2
to trim the date:

<xsl:value-of select="
substring-before(category/attributeset/attribute[@attid=4],'T')
"/>
Jul 20 '05 #3
> > <xsl:value-of select="category/attributeset/attribute/@attid=4"/>


IIRC it should be

<xsl:value-of select="category/attributeset/attribute[@attid=4]" />


Thanks for your feedback but it did not return any value.

Secondly, how can I trim the date if result is obtained?
Jul 20 '05 #4
Try

<xsl:value-of select="category/attributeset/attribute[@attid='4']"/>

AwanJohnie wrote:
I have an xml document as shown (not mine but extracted from an
application):

<category defid="468808" name="Global Information Attributes"
versionid="6">
<attributeset attid="1" name="Global Information Attributes">
<attribute attid="3" name="Issue_Date"
type="-7">2003-09-30T00:00:00</attribute>
<attribute attid="4" name="Review_Date"
type="-7">2006-10-30T00:00:00</attribute>
</attributeset>
</category>
I need to write an XSL to extract the values of 10 the Issue_Date (In
this case = 2003-09-30T00:00:00) and Review_Date (In this case =
2006-10-30T00:00:00)

I wrote this in my xsl:

<xsl:value-of select="category/attributeset/attribute/@attid=4"/>

It did not give me the desired result. It gave me a value = true.

In addition how can I trim the date to show only "2003-09-30" for
example.

Thanks


Jul 20 '05 #5
Goudvin Emmanuel <Em**************@voila.fr> wrote in message news:<U8****************@nntpserver.swip.net>...
Try

<xsl:value-of select="category/attributeset/attribute[@attid='4']"/>

AwanJohnie wrote:

THANKS EVERYBODY.
IT WORKED!!!
THE ACTUAL CODES USED.....

<xsl:value-of select="substring-before(category/attributeset/attribute[@attid='3'],'T')"/>
Jul 20 '05 #6

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

Similar topics

3
by: Kangol kangoll | last post by:
hi, i've been trying to figure out how to make visual basic start extracting text at a certain line to when i tell it to stop. I am making trying to make a program where it extracts text from a...
0
by: Peter Otten | last post by:
There is currently a discussion on python-dev about an extract() function which offers fast access to list items and object attributes. It could serve, e. g., as the key argument of the future...
7
by: svilen | last post by:
hello again. i'm now into using python instead of another language(s) for describing structures of data, including names, structure, type-checks, conversions, value-validations, metadata etc....
4
by: Lénaïc Huard | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I've some namespace problems when defining default values for attributes. My problem seems to come from the fact that the attributes are...
2
by: Adam Monsen | last post by:
The following script is a high-performance link (<a href="...">...</a>) extractor. I'm posting to this list in hopes that anyone interested will offer constructive...
1
by: James Lehman | last post by:
Hello. I want to write a program that reads AutoCAD shape (font) files. They are written with the convention that hexadecimal values have a leading zero and decimal values do not. All numbers...
16
by: EM.Bateman | last post by:
Working on Visual Studio .Net I've implemented a class: #ifndef CONTRIBUTOR_H #define CONTRIBUTOR_H enum Gender {male=1, female, unk}; #include <iostream> #include <iomanip> #include...
0
by: MikeY | last post by:
I'm having trouble extaction my image from my resource file using DictionaryEnumerator & ResourceReader. String extractions are good. I've been trying to look online for exact info on this, but...
5
by: Taras_96 | last post by:
Hi all, Jesse Liberty writes: "cin.get() >>myVarOne >myVarTwo; // illegal The return value of (cin.get() >myVarOne) is an integer, not an iostream object." ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.