Hi, 

I managed to solve my problem. The interresting thing is that I didn't find the 
solution
through documentation on XML schemas (Including w3c.org), but through this 
marvelous tool
Inst2xsd which in one run did exaclty what I needed. (Up for tool of the year 
award!). 
The solution is to define the alternative namespace In the element declaration 
like this: 
 
<xs:element type="TImage" name="image"/>
<xs:element ref="pod:image" 
xmlns:pod="http://www.itunes.com/dtds/podcast-1.0.dtd"/>

Two equally named elements from different namespaces are now accessible through 
the same
XmlObject. I am really curious to know if someone can point to a description, 
tutorial, article etc..
Which explains this concept. 

Thanks / Christophe

 
> -----Original Message-----
> From: Radu Preotiuc-Pietro [mailto:[EMAIL PROTECTED] 
> Sent: 08 Disember 2005 9:29
> To: user@xmlbeans.apache.org
> Subject: RE: Identical elements from different namespaces.
> 
> Yes, the rule is indeed that each Schema document can only 
> define elements/types in one namespace (or no namespace at 
> all) so you would have to write two different documents (this 
> being a Schema rule, of course, not an XmlBeans rule). But 
> there will be no overlap between them, so you won't parse 
> anything twice, right?
> 
> Radu
> 
> > -----Original Message-----
> > From: Christophe Bouhier (MC/ECM)
> > [mailto:[EMAIL PROTECTED]
> > Sent: Sunday, December 04, 2005 8:51 PM
> > To: 'user@xmlbeans.apache.org'
> > Subject: Identical elements from different namespaces.
> > 
> > 
> > Hello,
> > 
> > I am relative new user to xmlbeans. I have used it successfully for 
> > the last year with our current .xsd but now I need to extend the 
> > functionality of our application whereby I need some help/advise.
> > 
> > Our primary schema is an XSD for the popular RSS standard 
> which has no 
> > target namespace.
> > Recently www.apple.com has added some propriatary elements 
> which are 
> > defined here:
> > http://phobos.apple.com/static/iTunesRSS.html
> > 
> > Combining the two I have to process xml with elements like this: 
> > 
> > ...
> > <image height="" width=""/>
> > <itunes:image href="..."/>
> > ...
> > 
> > So now I have colliding element names from a 
> "notargetnamespace" and 
> > the itunes name space.
> > 
> > I have tried to define both elements into a single xsd but the 
> > xmlbeans compiler complains about uniques of elements. 
> Before I post 
> > my attempt, I would like to ask: Do I need to bother and 
> try to define 
> > the two namespaces into one single schema?, or shall I use two 
> > schema's? (Which means I have to parse the document twice and will 
> > have 2 XmlObjects.
> > 
> > I would be gratefull to whoever can provide me with help on how to 
> > tackle this problem. It comes to mind That is situation 
> should arise 
> > in many case when dealing with multiple namespaces.
> > 
> > Thank You ,
> > 
> > Christophe Bouhier.
> > www.jpodder.com
> > 
> > 
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to