Home » Developer & Programmer » JDeveloper, Java & XML » How to retrive - CreateDateStamp="2006-02-14T10:30:16.0Z" value
icon2.gif  How to retrive - CreateDateStamp="2006-02-14T10:30:16.0Z" value [message #163496] Thu, 16 March 2006 22:34 Go to next message
askshirsagar
Messages: 9
Registered: February 2006
Location: India
Junior Member

I am able to extract value of all attributes/nodes but I do not know the logic to retrive CreateDateStamp and
LastModifiedDateStamp <Organisation CreateDateStamp="2006-02-14T10:30:16.0Z" LastModifiedDateStamp="2006-02-14T10:30:16.0Z">

Please let me know if any one knows it.

Many thanks for your help.

Rgds,
Avinash


DECLARE
x XMLTYPE := XMLTYPE('
<Organisations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.oracle.com/Organisations.xsd"
CreateDateStamp="2006-02-14T11:49:17.0Z" LastModifiedDateStamp="2006-02-14T11:49:17.0Z">
<Organisation CreateDateStamp="2006-02-14T10:30:16.0Z" LastModifiedDateStamp="2006-02-14T10:30:16.0Z">
<SourceSystem>Maconomy</SourceSystem>
<OrganisationName>WARMWELL HOMES LTD</OrganisationName>
<OrganisationType>Ltd</OrganisationType>
<OrganisationAddresses>
<OrganisationAddress>
<Address>
SourceSystem>Maconomy</SourceSystem>
<OrganisationName></OrganisationName>
<DepartmentName></DepartmentName>
<SubBuildingName></SubBuildingName>
<BuildingName></BuildingName>
<BuildingNumber>1</BuildingNumber>
<DependentThoroughFareName></DependentThoroughFareName>
<DependentThoroughFareDescriptor></DependentThoroughFareDescriptor>
<DoubleDependentLocality></DoubleDependentLocality>
<ThoroughFareName></ThoroughFareName>
<ThoroughFareDescriptor>DANESBURY PARK</ThoroughFareDescriptor>
<LocalityElements></LocalityElements>
<DependentLocality></DependentLocality>
<PostTown>HERTFORD</PostTown>
<County></County>
<POBoxDetails></POBoxDetails>
<PostCode>SG14 3HX</PostCode>
<AddressAdditionalInfo></AddressAdditionalInfo>
</Address>
</Organisation>
</Organisations>');

BEGIN
FOR i IN ( SELECT
EXTRACTVALUE(VALUE(t), '/Organisation/OrganisationName') T_OrganisationName,
EXTRACTVALUE(VALUE(t), '/Organisation/SourceSystem') T_SourceSystem,
EXTRACTVALUE(VALUE(t), '/Organisation/OrganisationRegNo') T_OrganisationRegNo,
EXTRACTVALUE(VALUE(t), '/Organisation/OrganisationType') T_OrganisationType,
EXTRACTVALUE(VALUE(t), '/Organisation/OrganisationVatNo') T_OrganisationVatNo,
EXTRACTVALUE(VALUE(t), '/Organisation/OrganisationTradingNames/OrganisationTradingName') T_OrganisationTradingName,
EXTRACTVALUE(VALUE(t), '/Organisation/OrganisationAddresses/OrganisationAddress/AddressType') AddressType,
EXTRACT(VALUE(t), '/Organisation/OrganisationAddresses/OrganisationAddress/Contacts/Contact') Contact_xml
FROM TABLE(XMLSEQUENCE(EXTRACT(x, '/Organisations/Organisation'))) t )
LOOP
DBMS_OUTPUT.PUT_LINE('Address Type ' || i.AddressType);
END LOOP;
END;
Re: How to retrive - CreateDateStamp="2006-02-14T10:30:16.0Z" value [message #164095 is a reply to message #163496] Tue, 21 March 2006 16:29 Go to previous messageGo to next message
mchadder
Messages: 224
Registered: May 2005
Location: UK
Senior Member
Hello.

You use the @ syntax to access XML attributes, i.e.
EXTRACTVALUE(VALUE(t), '/Organisation/@CreateDateStamp')

Rgds
Re: How to retrive - CreateDateStamp="2006-02-14T10:30:16.0Z" value [message #164391 is a reply to message #164095] Thu, 23 March 2006 04:42 Go to previous message
askshirsagar
Messages: 9
Registered: February 2006
Location: India
Junior Member

Thanks for your help.

Rgds,
Previous Topic: how to give link of pages in Tree
Next Topic: xml editor
Goto Forum:
  


Current Time: Thu Apr 25 13:06:33 CDT 2024