You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlbeans-user@xml.apache.org by Ramesh Regulapati <rr...@yahoo.com> on 2003/12/10 16:46:34 UTC

With with Substitution Group.

Hi All,

Recently I have started using XMLBean in our project.I
am new to XML schema and XMLBeans.

I went through the documentation and mailing list to
see if any one else had solution to the problem that i
was facing.
Since it was not listed, thought we would ask for
help.

I have generated the class files using the utility
"scomp".

The problem I am facing is how to read this xml and
get A1Record object from Record type.
	
	XMLSchema
	__________
	
	<?xml version="1.0" encoding="UTF-8"?>
	<schema targetNamespace="http://www.me.com/abc"
xmlns:q="http://www.me.com/abc"
xmlns="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified" version="3.0.0.0">
		<include schemaLocation="A1Record.xsd"/>
		<include schemaLocation="A2Record.xsd"/>
		<include schemaLocation="A3Record.xsd"/>
		<include schemaLocation="A4Record.xsd"/>
		<element name="RecordGroup"
type="q:RecordGroupType">
		</element>
		<complexType name="RecordGroupType">
			<complexContent>
				<extension base="q:GroupType">
					<sequence>
						<element ref="q:Record"/>
					</sequence>
				</extension>
			</complexContent>
		</complexType>
		<complexType name="GroupType" abstract="true">
			<sequence>
				<element name="Owner" type="q:OwnerType">
				</element>
				<element name="Timestamp" type="dateTime">
				</element>
			</sequence>
		</complexType>
	</schema>
	
	XML Data File
	--------------
	<?xml version="1.0" encoding="UTF-8"?>
	<RecordGroup xmlns="http://www.me.com/abc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
		xsi:schemaLocation="http://www.me.com/abc
c:\RecordGroup.xsd" id="1" name="1234" seq="1"
batchID="57301">
		<Owner>
		        <Name></Name>
  	        </Owner>
	        
	        <Timestamp></Timestamp>
                
                <A1Record>
                <?A1Record>
		
	</RecordGroup>	
	
	Code Used
	---------
	
	RecordGroupType recordType =
RecordGroupType.Factory.parse(xmlfile);
	       
	
	
	
RecordType has only getOwner(), getTimestamp(), and
getRecord() these getter method.
Record is not being parsed and getRecord() is
returning null always.
How do I get hold of A1Record?
	       
Thanks For Your help
Ramesh R

__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/