|
osdir.com mailing list archive |
|
|
|
Subject: Re: xmlns empty string - msg#00158List: text.xml.devel> means that you want locally-declared elements like contact to be in no namespace. Doesn't 'unqualified element form' specifies wether or not an element use explicit ns prefix ? qualified : <ns:Contact /> unqualified: <Contact /> Can the <Contact /> element take the Chameleon namespace from its parent element ? for instance: <Contacts xmlns="aa"> <Contact /> </Contacts> Thanks, ran On 12/20/06, Michael Kay <mike@xxxxxxxxxxxx> wrote: elementFormDefault="unqualified" means that you want locally-declared elements like contact to be in no namespace. Whatever tool it was that generated the instance document has honoured that request. It's almost always more appropriate to use elementFormDefault="qualified". Michael Kay http://www.saxonica.com/ From: Ran [mailto:ran256@xxxxxxxxx] Sent: 19 December 2006 23:05 To: Andrew Welch; xml-dev@xxxxxxxxxxxxx Subject: Re: [xml-dev] xmlns empty string Thanks for the reply. I believe I specified Contact's ns in schema as targetNamespace. Here is my wsdl:type <wsdl:types> <xsd:schema xmlns:tns=" http://web.com/CRMUsers/types/test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns=" http://web.com/CRMUsers" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace=" http://web.com/CRMUsers/types/test"> <xsd:include schemaLocation="xsd0.xsd" /> <xsd:complexType name="ContactReturnType "> <xsd:sequence> <xsd:element name="contact" nillable="true" type="r:ContactType" /> </xsd:sequence> </xsd:complexType> <xsd:element name=" contacts" nillable="true" type="r:ContactReturnType" /> ... </xsd:schema> </wsdl:types> <!-- xsd0.xsd --> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="unqualified"> <xsd:complexType name=" ContactType"> <xsd:attribute name="id" type="xsd:string" /> <xsd:attribute name="firstName" type="xsd:string" /> <xsd:attribute name="lastName" type="xsd:string" /> <xsd:attribute name="email" type="xsd:string" /> </xsd:complexType> </xsd:schema> On 12/19/06, Andrew Welch <andrew.j.welch@xxxxxxxxx> wrote: On 12/19/06, Ran <ran256@xxxxxxxxx> wrote: > Hi, > > I have the following schema instance and the xmlns on contact nodes are > empty strings. > I use xmlbeans for databinding in Axis2. and would like to not use any ns on > contact. > > How do I manupulate xmlns in my schema (or using xbean api) for contact node > to get rid of xmlns="" ? > > <Contacts xmlns=" www.example.com"> > <Contact xmlns="" id="3" name="abc2" /> > <Contact xmlns="" id="4" name="abc3" /> > <Contact xmlns="" id="5" name="abc4" /> > .... > </Contacts> Put the <Contact> elements in the "www.example.com" namespace - currently they are in no namespace, hence the xmlns="" cheers andrew
Thread at a glance:
Previous Message by Date:RE: Line number of a nodeThank you for your advices,I think that the best way will be to use the class NodeImpl of Saxon because I have seen the method getLineNumber(), do you know how can I create a NodeImpl with XPath? some example please. Thank you again. From: "Michael Kay" <mike@xxxxxxxxxxxx> To: 'Beatriz San Miguel González' <beuchisan@xxxxxxxxxxx>,<xml-dev@xxxxxxxxxxxxx> Subject: RE: [xml-dev] Line number of a node Date: Wed, 20 Dec 2006 15:50:22 -0000 The Saxon tree model allows you to store line numbers if you set an appropriate flag when building the tree. But this is a read-only model - it's suitable if most of your access is through XPath but you might not want to use it otherwise. XOM allows you to define subclasses of the standard node classes so that extra information can be stored, this would allow you to capture the line numbers from SAX while building the tree. However, this involves writing your own node factory class. Michael Kay http://www.saxonica.com/ > -----Original Message----- > From: Beatriz San Miguel González [mailto:beuchisan@xxxxxxxxxxx] > Sent: 20 December 2006 15:38 > To: mike@xxxxxxxxxxxx; xml-dev@xxxxxxxxxxxxx > Subject: RE: [xml-dev] Line number of a node > > I don't know what API can be useful. I have used SAX, dom and > dom4j but it's don't work. I have read about XOM and I think > that it's not possible. > I need some suggestion about what API I can use. The only > requirement is to use Java. > > Thanks! > > > >From: "Michael Kay" <mike@xxxxxxxxxxxx> > >To: 'Beatriz San Miguel González' > ><beuchisan@xxxxxxxxxxx>,<xml-dev@xxxxxxxxxxxxx> > >Subject: RE: [xml-dev] Line number of a node > >Date: Wed, 20 Dec 2006 15:25:57 -0000 > > > > > > > > Is there is a way to find out the line number of a node? > > > > > > >It rather depends on what API you are using. In the DOM API, > I believe > >the answer is no. > > > >Michael Kay > >http://www.saxonica.com/ > > > > > >_____________________________________________________________ > __________ > > > >XML-DEV is a publicly archived, unmoderated list hosted by OASIS to > >support XML implementation and development. To minimize spam in the > >archives, you must subscribe before posting. > > > >[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/ > >Or unsubscribe: xml-dev-unsubscribe@xxxxxxxxxxxxx > >subscribe: xml-dev-subscribe@xxxxxxxxxxxxx List archive: > >http://lists.xml.org/archives/xml-dev/ > >List Guidelines: http://www.oasis-open.org/maillists/guidelines.php > > > > _________________________________________________________________ > Grandes éxitos, superhéroes, imitaciones, cine y TV... > http://es.msn.kiwee.com/ Lo mejor para tu móvil. > _________________________________________________________________ Acepta el reto MSN Premium: Correos más divertidos con fotos y textos increíbles en MSN Premium. Descárgalo y pruébalo 2 meses gratis. http://join.msn.com?XAPID=1697&DI=1055&HL=Footer_mailsenviados_correosmasdivertidos _______________________________________________________________________ XML-DEV is a publicly archived, unmoderated list hosted by OASIS to support XML implementation and development. To minimize spam in the archives, you must subscribe before posting. [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/ Or unsubscribe: xml-dev-unsubscribe@xxxxxxxxxxxxx subscribe: xml-dev-subscribe@xxxxxxxxxxxxx List archive: http://lists.xml.org/archives/xml-dev/ List Guidelines: http://www.oasis-open.org/maillists/guidelines.php Next Message by Date:RE: xmlns empty stringMichael Kay writes: > I forget how chameleon namespaces interact with > elementFormDefault - it's a facility I never use, so I would > have to look it up. OK, so I was feeling guilty about not remembering either, so I looked it up. From [1] (in which SII' is the schema document doing the including): 3.2 If clause 2.3 above is satisfied [I.e. if the targetNamespace of the included schema document is missing...Noah] , then the schema corresponding to the <include>d item's parent <schema> must include not only definitions or declarations corresponding to the appropriate members of its own [children], but also components identical to all the Âschema components of I, except that anywhere the Âabsent target namespace name would have appeared, the Âactual value of the targetNamespace [attribute] of SIIâ is used. In particular, it replaces Âabsent in the following places: 3.2.1 The {target namespace} of named schema components, both at the top level and (in the case of nested type definitions and nested attribute and element declarations whose code was qualified) nested within definitions; 3.2.2 The {namespace constraint} of a wildcard, whether negated or not; In case that for some reason that seems unclear, I'll translate: you can mostly assume that the included schema document behaves as if it did have a targetNamespace corresponding to that of the including schema document. Specifically, this is true for "nested attribute and element declarations that have as their code "qualififed", which are the ones in question. If your elementForm is qualified, then the namespace used will be that of the including schema document. That's my reading anyway. Noah [1] http://www.w3.org/TR/2004/PER-xmlschema-1-20040318/#compound-schema -------------------------------------- Noah Mendelsohn IBM Corporation One Rogers Street Cambridge, MA 02142 1-617-693-4036 -------------------------------------- Previous Message by Thread:RE: xmlns empty stringelementFormDefault="unqualified" means that you want locally-declared elements like contact to be in no namespace. Whatever tool it was that generated the instance document has honoured that request. It's almost always more appropriate to use elementFormDefault="qualified". Michael Kay http://www.saxonica.com/ From: Ran [mailto:ran256@xxxxxxxxx] Sent: 19 December 2006 23:05To: Andrew Welch; xml-dev@xxxxxxxxxxxxxSubject: Re: [xml-dev] xmlns empty string Thanks for the reply.I believe I specified Contact's ns in schema as targetNamespace. Here is my wsdl:type <wsdl:types> <xsd:schema xmlns:tns=" http://web.com/CRMUsers/types/test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns=" http://web.com/CRMUsers" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace=" http://web.com/CRMUsers/types/test"> <xsd:include schemaLocation="xsd0.xsd" /> <xsd:complexType name="ContactReturnType "> <xsd:sequence> <xsd:element name="contact" nillable="true" type="r:ContactType" /> </xsd:sequence> </xsd:complexType> <xsd:element name=" contacts" nillable="true" type="r:ContactReturnType" /> ... </xsd:schema> </wsdl:types><!-- xsd0.xsd --><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="unqualified"> <xsd:complexType name=" ContactType"> <xsd:attribute name="id" type="xsd:string" /> <xsd:attribute name="firstName" type="xsd:string" /> <xsd:attribute name="lastName" type="xsd:string" /> <xsd:attribute name="email" type="xsd:string" /> </xsd:complexType></xsd:schema> On 12/19/06, Andrew Welch <andrew.j.welch@xxxxxxxxx> wrote: On 12/19/06, Ran <ran256@xxxxxxxxx> wrote:> Hi,>> I have the following schema instance and the xmlns on contact nodes are> empty strings.> I use xmlbeans for databinding in Axis2. and would like to not use any ns on > contact.>> How do I manupulate xmlns in my schema (or using xbean api) for contact node> to get rid of xmlns="" ?>> <Contacts xmlns=" www.example.com">> <Contact xmlns="" id="3" name="abc2" />> <Contact xmlns="" id="4" name="abc3" />> <Contact xmlns="" id="5" name="abc4" /> > ....> </Contacts>Put the <Contact> elements in the "www.example.com" namespace -currently they are in no namespace, hence the xmlns="" cheersandrew Next Message by Thread:RE: xmlns empty stringNo, it's got nothing to do with the choice of prefix. It's the namespace that matters, not the prefix. elementFormDefault="unqualified" means the element will not be in a namespace, and will therefore have no prefix. I forget how chameleon namespaces interact with elementFormDefault - it's a facility I never use, so I would have to look it up. Michael Kay From: Ran [mailto:ran256@xxxxxxxxx] Sent: 20 December 2006 17:40To: Michael KayCc: Andrew Welch; xml-dev@xxxxxxxxxxxxxSubject: Re: [xml-dev] xmlns empty string > means that you want locally-declared elements like contact to be in no namespace.Doesn't 'unqualified element form' specifies wether or not an element use explicit ns prefix ?qualified :<ns:Contact />unqualified: <Contact />Can the <Contact /> element take the Chameleon namespace from its parent element ? for instance:<Contacts xmlns="aa"> <Contact /></Contacts>Thanks,ran On 12/20/06, Michael Kay <mike@xxxxxxxxxxxx> wrote: elementFormDefault="unqualified" means that you want locally-declared elements like contact to be in no namespace. Whatever tool it was that generated the instance document has honoured that request. It's almost always more appropriate to use elementFormDefault="qualified". Michael Kay http://www.saxonica.com/ From: Ran [mailto:ran256@xxxxxxxxx] Sent: 19 December 2006 23:05To: Andrew Welch; xml-dev@xxxxxxxxxxxxxSubject: Re: [xml-dev] xmlns empty string Thanks for the reply.I believe I specified Contact's ns in schema as targetNamespace. Here is my wsdl:type <wsdl:types> <xsd:schema xmlns:tns=" http://web.com/CRMUsers/types/test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns=" http://web.com/CRMUsers" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace=" http://web.com/CRMUsers/types/test"> <xsd:include schemaLocation="xsd0.xsd" /> <xsd:complexType name="ContactReturnType "> <xsd:sequence> <xsd:element name="contact" nillable="true" type="r:ContactType" /> </xsd:sequence> </xsd:complexType> <xsd:element name=" contacts" nillable="true" type="r:ContactReturnType" /> ... </xsd:schema> </wsdl:types><!-- xsd0.xsd --><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="unqualified"> <xsd:complexType name=" ContactType"> <xsd:attribute name="id" type="xsd:string" /> <xsd:attribute name="firstName" type="xsd:string" /> <xsd:attribute name="lastName" type="xsd:string" /> <xsd:attribute name="email" type="xsd:string" /> </xsd:complexType></xsd:schema> On 12/19/06, Andrew Welch <andrew.j.welch@xxxxxxxxx> wrote: On 12/19/06, Ran <ran256@xxxxxxxxx> wrote:> Hi,>> I have the following schema instance and the xmlns on contact nodes are> empty strings.> I use xmlbeans for databinding in Axis2. and would like to not use any ns on > contact.>> How do I manupulate xmlns in my schema (or using xbean api) for contact node> to get rid of xmlns="" ?>> <Contacts xmlns=" www.example.com">> <Contact xmlns="" id="3" name="abc2" />> <Contact xmlns="" id="4" name="abc3" />> <Contact xmlns="" id="5" name="abc4" /> > ....> </Contacts>Put the <Contact> elements in the "www.example.com" namespace -currently they are in no namespace, hence the xmlns="" cheersandrew
Web Hosting Reviews from OSDir.com Sister Site iBizWebHosting.com
|
|