Hi Gareth, thanks for your answer. I bound a prefix as you suggested and declared a namespace. But in this case the parser generates also an error message. The parser does not accept the namespace for the Schema B in connection with the include element. The parser suggests the import element. But my Schema A und the Schema B have the same namespace. Consequently i think it is right to use the include element.
Do you have any further ideas? Thanks in advance, Mirko -----Ursprüngliche Nachricht----- Von: Gareth Reakes [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 30. November 2004 16:53 An: [EMAIL PROTECTED] Betreff: Re: AW: include Schema in a Schema Hey, > thank you very much for your answer. > But i was not able to solve my problem. > > > You don't seem to bound the prefix as I suggested. Is there any part of my answer that requires further explanation? Let me try using your schema fragment as an example: >Schema A: > > <?xml version="1.0" encoding="UTF-8" standalone="no"?> <xsd:schema > xmlns:xsd="http://www.w3.org/2001/XMLSchema"> > <xsd:include schemaLocation="xhtml.xsd"/> > > The Schema A uses one XHTML tag (<p>) (defined in Schema B) as a part > of a ComplexType (please see below) definition. > > <xsd:element maxOccurs="unbounded" minOccurs="0" type="p" name="p"/> > > > Note here that the default namespace is the null namespace. You are trying to look up p in the null namespace, so it is not using p from schema B. You need to bind a prefix to the xhtml namespace. A rewritten version (I have not tested it, so forgive typos) might look like <?xml version="1.0" encoding="UTF-8" standalone="no"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xhtml="whatever the namespace is"> <xsd:include schemaLocation="xhtml.xsd"/> <xsd:element maxOccurs="unbounded" minOccurs="0" type="xhtml:p" name="p"/> Gareth > >Schema xhtml (Schema B): > > <?xml version="1.0" encoding="UTF-8" standalone="no"?> > <!--Version: 01.14.04--> > <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> > > >Errormessages of Xercesc 2-3-0: > > "Type not Found in :p" > "Untyped element :p" > > > > > Can somebody help me? > > Thanks in advance, Mirko > > > >-----Ursprüngliche Nachricht----- >Von: Gareth Reakes [mailto:[EMAIL PROTECTED] >Gesendet: Donnerstag, 4. November 2004 16:41 >An: [EMAIL PROTECTED] >Betreff: Re: include Schema in a Schema > > >Hi, > you are trying to reference p in the null namespace. You need to >bind a prefix to the xhtml namespace and then >reference it via that prefix. > >Gareth > >Mirko Braun wrote: > > > >>Hi all, >> >>i would like to parse a XML file validating against a Schema A. And >>this Schema A includes another Schema B (defines XHTML tags) . The >>code below shows the include mechanism of Schema B >>in Schema A. >> >> >><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> >> <xsd:include schemaLocation="xhtml.xsd"/> >> >> >>The Schema A uses one XHTML tag (<p>) as a part of a ComplexType >>(please see below) definition. >> >> <xsd:element maxOccurs="unbounded" minOccurs="0" type="p" >>name="p"/> >> >> >> >>When i parse my XML file. The parser create following error messages: >> >>"Type not Found in :p" >>"Untyped element :p" >> >>Can anybody help me? >> >>Thanks in advance, >> >>Mirko >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: [EMAIL PROTECTED] For >>additional commands, e-mail: [EMAIL PROTECTED] >> >> > > > > -- Gareth Reakes, Managing Director Parthenon Computing +44-1865-811184 http://www.parthcomp.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]