DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2010
    Posts
    1

    How to break a huge xml into small ones based on element value in xmlbeans?

    Hi All,

    I am new to xmlbeans. I have attached here the xsd I use. I get a very huge xml and my requirement is to chunk them based on 'Locality' which is a alphanumberic type. I should produce xml for identical localities.
    Can you please provide me a hint on how to proceed with this. Should I use xquery/xpath or stax. Which would be more efficient as the Localities list is huge as well( we have 100 localities).


    <?xml version="1.0" encoding="UTF-8" ?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified" version="1.00">
    <xs:include schemaLocation="simple_types_sys.xsd" />
    <xs:include schemaLocation="complex_types_sys.xsd" />

    <xs:element name="office" type="OfficeType" />
    <xs:complexType name="OfficeType">
    <xs:sequence>
    <xs:group ref="Reference" />
    <xs:element name="Location" type="LocType" minOccurs="0"
    maxOccurs="99">
    <xs:annotation>
    <xs:documentation>
    <description value="place" />
    </xs:documentation>
    </xs:annotation>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    <xs:group name="Reference">
    <xs:sequence>
    <xs:element name="RefType" type="Alphanumeric_Max5">
    <xs:annotation>
    <xs:documentation>
    <description value="Reference Type" />
    </xs:documentation>
    </xs:annotation>
    </xs:element>
    <xs:element name="Valid" type="Alpha_3">
    <xs:annotation>
    <xs:documentation>
    <description value="Validity" />
    </xs:documentation>
    </xs:annotation>
    </xs:element>
    <xs:element name="Insured" type="Alpha_3">
    <xs:annotation>
    <xs:documentation>
    <description value="Insured" />
    </xs:documentation>
    </xs:annotation>
    </xs:element>
    </xs:sequence>
    </xs:group>

    <xs:complexType name="LocType">
    <xs:annotation>
    <xs:documentation>
    <description value="place" />
    </xs:documentation>
    </xs:annotation>
    <xs:sequence>
    <xs:element name="Locality" type="LocalityType">
    <xs:annotation>
    <xs:documentation>
    <description value="Locality" />
    <codeList name="LCodeFullList" type="code" />
    </xs:documentation>
    </xs:annotation>
    </xs:element>
    <xs:element name="Sys" type="SysType" maxOccurs="9">
    <xs:annotation>
    <xs:documentation>
    <description value="Systems" />
    </xs:documentation>
    </xs:annotation>
    </xs:element>
    <xs:element name="Function" type="FunctionType" maxOccurs="99">
    <xs:annotation>
    <xs:documentation>
    <description value="Description" />
    </xs:documentation>
    </xs:annotation>
    </xs:element>
    </xs:sequence>
    </xs:complexType>

    </xs:schema>

    Thanks in advance
    Nicky

  2. #2
    Join Date
    Oct 2008
    Posts
    141

    xpath

    hi there,

    maybe, this could be so simple as "//Locality", or the first one "//Locality[1]", or the last one as "//Locality[last()]", even maybe "//Locality/*".

    best regards,

    tonci korsano

Similar Threads

  1. Replies: 1
    Last Post: 03-03-2006, 07:16 AM
  2. Replies: 1
    Last Post: 08-07-2000, 10:16 AM
  3. SELECT form element with XML and XSL
    By Peter B. in forum XML
    Replies: 0
    Last Post: 06-17-2000, 04:46 AM
  4. Replies: 0
    Last Post: 06-16-2000, 05:41 PM
  5. URGENT : Changing the value of a XML node (Element)
    By Frank Devliegher in forum XML
    Replies: 0
    Last Post: 04-12-2000, 06:25 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links