Hello!

I am working with UBL (Universal Business Language). Itīs a XML but with its namespace. I want to search within the document UBL.
The document is named: seat-leon.xml . The content of the document is:

<Catalogue xmlns="urn:oasis:names:specification:ubl:schema:xsd:Catalogue-2"
           xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
           xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
           xmlns:ccts="urn:un:unece:uncefact:documentation:2"
           xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
           xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2"
           xmlns:udt="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2"
           xmlns:xsd="http://www.w3.org/2001/XMLSchema"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="urn:oasis:names:specification:ubl:schema:xsd:Catalogue-2 file:/P:/UBL-Space/catalog/UBL/cs-UBL-2.0/xsd/maindoc/UBL-Catalogue-2.0.xsd">
<cbc:ID>1111</cbc:ID>
<cbc:IssueDate>2007-10-10+02:00</cbc:IssueDate>
<cac:ProviderParty>
    <cbc:EndpointID>jamoradiaz</cbc:EndpointID>
</cac:ProviderParty>
<cac:ReceiverParty/>
<cac:CatalogueLine/>
    <cac:CatalogueLine>
        <cbc:ID>Seat leon</cbc:ID>
        <cac:Item>
            <cac:AdditionalItemProperty>
                <cbc:Name>Color</cbc:Name>
                <cbc:Value>Rojo</cbc:Value>
            </cac:AdditionalItemProperty>
            <cac:AdditionalItemProperty>
                <cbc:Name>Matriculacion</cbc:Name>
                <cbc:Value>2005</cbc:Value>
            </cac:AdditionalItemProperty>
            <cac:AdditionalItemProperty>
                <cbc:Name>kilometros</cbc:Name>
                <cbc:Value>102.000</cbc:Value>
            </cac:AdditionalItemProperty>
        </cac:Item>
    </cac:CatalogueLine>
</Catalogue>

I would like to get "cbc:ID" and get 1111. For it, I made the file "seat-leon.xql" :

declare namespace cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2";
declare namespace cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2";
declare namespace ccts="urn:un:unece:uncefact:documentation:2";
declare namespace ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2";
declare namespace qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2";
declare namespace udt="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2";
declare namespace xsd="http://www.w3.org/2001/XMLSchema";
declare namespace xsi="http://www.w3.org/2001/XMLSchema-instance";
declare namespace schemaLocation="urn:oasis:names:specification:ubl:schema:xsd:Catalogue-2 file:/P:/UBL-Space/catalog/UBL/cs-UBL-2.0/xsd/maindoc/UBL-Catalogue-2.0.xsd";

for $b in doc("seat-leon.xml")//Catalogue/cbc:ID return $b

I would like get 1111, but the screen show me the next:

<?xml version="1.0" encoding="UFT-8"?>

I donīt know what to do. Someone know what can I do?

Thank you very much.






Express yourself instantly with MSN Messenger! MSN Messenger