XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 7th, 2004, 07:33 PM
emye emye is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 3 emye User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Value-of for attributes

I am trying to use xsl:value-of to get the value of the attribute for an xml transformation. The xml code is

<ili:EXTENSION>
<ili:NODE NAME="ACTOR" TYPE="STRING"/>
</ili:EXTENSION>

and I am trying to get the values for name and type. I have tried <xsl:value-of select="//CUSTOM_NODE/@NAME"/> as well as <xsl:value-of select="//ili:CUSTOM_NODE/@NAME"/> and could not get output for either. Any help would be greatly appreciated. Finally, I would like to use the for-each command. How is this used with attributes?

Reply With Quote
  #2  
Old April 8th, 2004, 07:27 AM
fpmurphy fpmurphy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: USA
Posts: 289 fpmurphy User rank is Corporal (100 - 500 Reputation Level)fpmurphy User rank is Corporal (100 - 500 Reputation Level)fpmurphy User rank is Corporal (100 - 500 Reputation Level)fpmurphy User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 3 h 22 m 4 sec
Reputation Power: 6
Here is an example of a quick and dirty way of
handling the "ili" namespace. There are more
elegant ways. Refer to the namespace section of
any good XML/XSL textbook for further information.

Code:
<?xml version="1.0"?>
<ili:EXTENSION xmlns:ili="http://www.eaugallieboatworks.com/my.xsl">
    <ili:NODE NAME="ACTOR" TYPE="STRING"/>
</ili:EXTENSION>


Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
 
<xsl:stylesheet version="1.0" 
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:ili="http://www.eaugallieboatworks.com/my.xsl">

<xsl:output method="html"/>

<xsl:template match="/">
     <xsl:apply-templates select="/ili:EXTENSION/ili:NODE"/>
</xsl:template>

<xsl:template match="/ili:EXTENSION/ili:NODE">
     <xsl:value-of select="@NAME"/>
</xsl:template>

</xsl:stylesheet>

Reply With Quote
  #3  
Old April 14th, 2004, 01:45 PM
emye emye is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 3 emye User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question ili namespace in a table?

Is it possible to output the values into a table for the ili namespace? If yes, what is the code? Thank you so very much for your reply.

Reply With Quote
  #4  
Old April 15th, 2004, 10:51 AM
fpmurphy fpmurphy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: USA
Posts: 289 fpmurphy User rank is Corporal (100 - 500 Reputation Level)fpmurphy User rank is Corporal (100 - 500 Reputation Level)fpmurphy User rank is Corporal (100 - 500 Reputation Level)fpmurphy User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 3 h 22 m 4 sec
Reputation Power: 6
Yes, it is possible. Provide a sample xml file and
details of the table type (row, colums, etc) and
we can possibly help you.

Reply With Quote
  #5  
Old April 19th, 2004, 05:11 PM
emye emye is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 3 emye User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I am trying to make a table with two columns, one for "name" and one for "type." The sample xml code is as follows:

<ili:EXTENSION>
<ili:NODE NAME="ACTOR" TYPE="STRING"/>
</ili:EXTENSION>
<ili:EXTENSION>
<ili:CUSTOM_NODE NAME="PERSON" TYPE="STRING">
</ili:EXTENSION>

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Value-of for attributes


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT