Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 16th, 2005, 10:16 AM
Registered User
 
Join Date: Jun 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default XPath not finding nodes, need help

Have this:

<?xml version="1.0" encoding="ISO-8859-1"?>

<CleansingMessage xmlns="http://www.lagan.com/schemas/Cleansing" xmlns:bs7666="http://www.govtalk.gov.uk/people/bs7666" xmlns:person="http://www.govtalk.gov.uk/people/AddressAndPersonalDetails" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.lagan.com/schemas/Cleansing http://margey/jms/xml/schemas/Cleansing">
    <PremiseDetailsResponse>
        <RequestID>XYZ12</RequestID>
        <Bin>
            <BinType>A240N</BinType>
            <BinID>723146</BinID>
            <BinQuantity>1</BinQuantity>
            <BinValidityStatus>active</BinValidityStatus>
            <RegisteredDate/>
            <Collections>
                <CollectionDay>2</CollectionDay>
                <CollectionGang>H13TU</CollectionGang>
                <CollectionRoundID>000122</CollectionRoundID>
                <CollectionRoundType/>
                <TimeOfDay/>
                <CollectionDescription/>
            </Collections>
        </Bin>
        <Bin>
            <BinType>RECYCLE</BinType>
            <BinID>946291</BinID>
            <BinQuantity>1</BinQuantity>
            <BinValidityStatus>active</BinValidityStatus>
            <RegisteredDate/>
            <Collections>
                <CollectionDay>2</CollectionDay>
                <CollectionGang>R13TU</CollectionGang>
                <CollectionRoundID>000239</CollectionRoundID>
                <CollectionRoundType/>
                <TimeOfDay/>
                <CollectionDescription/>
            </Collections>
        </Bin>
        <NextBulkDay>2005-06-21</NextBulkDay>
        <PremiseRefuseType>Wheel out</PremiseRefuseType>
        <BinLocationDetails/>
        <PremiseNotes/>
        <PremiseValidityStatus>active</PremiseValidityStatus>
        <Pathfinder/>
        <AdditionalPremiseDetails>
            <Name>Status</Name>
            <Value/>
        </AdditionalPremiseDetails>
        <AdditionalPremiseDetails>
            <Name>Nhofficer</Name>
            <Value/>
        </AdditionalPremiseDetails>
        <AdditionalPremiseDetails>
            <Name>AreaCode</Name>
            <Value/>
        </AdditionalPremiseDetails>
    </PremiseDetailsResponse>
</CleansingMessage>


Need to pull out all <CollectionDay>'s. Using "//CollectionDay" but no nodes are being returned.

HELP!!!
 
Old June 16th, 2005, 10:49 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Your source document contains

xmlns="http://www.lagan.com/schemas/Cleansing"

so all the unqualified element names are in a namespace. So your stylesheet needs to specify

xmlns:x="http://www.lagan.com/schemas/Cleansing"

and the names need to be written as //x:CollectionDay



Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to value in b/n nodes Swetha XSLT 1 May 20th, 2008 12:20 PM
XPATH removing nodes from file?? dparsons ASP.NET 2.0 Professional 1 February 27th, 2007 05:37 PM
How to use Xpath to extract child nodes smilysuresh XSLT 3 February 23rd, 2007 06:32 AM
Finding values from duplicated nodes swwallace XSLT 1 March 2nd, 2006 05:21 AM
XPath - Selecting nodes based on attribute values billy_bob_the_3rd XML 4 December 1st, 2004 06:12 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.