[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Getting the value of an attribute

Subject: Getting the value of an attribute
From: "Bradley, Peter" <pbradley@xxxxxxxxxx>
Date: Mon, 29 Sep 2008 16:41:17 +0100
 Getting the value of an attribute
I suspect this may be a very silly question.  If so, my apologies.

If I have this source document (fragment):

?xml version="1.0" encoding="UTF-8"?>
<error>
    <body>
        <timestamp>11/26/2007 5:43:41 PM</timestamp>
        <message>HandlingInstanceID:
3385d1e7-6173-44b8-93a6-ba82bdf462ad
            <Exception>
...
                <additionalInfo>
                    <info name="MachineName" value="Test"/>
                    <info name="TimeStamp" value="11/26/20007 5:43:41
PM"/>
                    <info name="FullName"
value="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=null"/>
                    <info name="AppDomainName"
value="/LM/W3SVC/165639889/Root-1-128115363895000000"/>
                    <info name="ThreadIdentity" value=""/>
                    <info name="WindowsIdentity" value="NT
AUTHORITY\NETWORK SERVICE"/>
                </additionalInfo>
            </Exception>
        </message>
...
    </body>
</error>

Why does this stylesheet (fragment):

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
...
    <xsl:template match="body/message">
        <Msg>
            <Error>
                <xsl:attribute name="appDomainName">
                    <xsl:value-of
select="Exception/additionalInfo/info[@name='AppDomainName']/@name"/>
                </xsl:attribute>
...
            </Error>
        </Msg>
    </xsl:template>
</xsl:stylesheet>

not give me the value of the AppDomainName attribute in the
appDomainName attribute of <Error> below:

<Msg>
    <Error appDomainName="AppDomainName "/>
</Msg>
...

I have the feeling that this should be obvious to me, but it has been a
busy day, so if anyone would be kind enough to put me out of my misery,
I would be eternally grateful.

Thanks


Peter

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.