xml-xmlbeans-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "nn" <nna...@comcast.net>
Subject Re: bug fix for XPath using Namespace
Date Tue, 22 Jun 2004 00:53:02 GMT
Actully, if XMLBeans want to handle XML objects using different prefix for
the same URI, this approach won't work.
probablly Eric's original approach must be used (declare namespace or using
nemaspceContext).
Another approach is to use default prefix avoiding explicit prefix usage in
XPath. then it should work for different prefix defitions. or define the
prefix 'abc' with target's namespace's URI though this looks dirty hack..

nn

----- Original Message ----- 
From: "nn" <nnakae@comcast.net>
To: <xmlbeans-dev@xml.apache.org>
Sent: Monday, June 21, 2004 5:30 PM
Subject: Re: bug fix for XPath using Namespace


> According to the jaxen's document, p.63 of
>
> http://jaxen.org/pdf/intro-slides.pdf
>
> .//abc:bar will match to bar as long as each namespaces are assigned to
the
> same uri.
> So the choice of prefix is not so important.
> (I have not tested this in program though)
>
> In particular, if we use top level namespace declaration in the target
> document, there should be not much problem for using it for prefix. Anyway
> if we don't use it, conditioned XPath cannot be processed.
> if people want to use different prefix, they should use
setNamespaceContext,
> but simply using prefix in document seems more reasonable approach to
avoid
> confusion.
>
> nn
>
> ----- Original Message ----- 
> From: <Dmitri.Colebatch@toyota.com.au>
> To: <xmlbeans-dev@xml.apache.org>
> Sent: Monday, June 21, 2004 5:07 PM
> Subject: RE: bug fix for XPath using Namespace
>
>
> > Can I chime in here....  If I have the following xpath:
> >
> > declare namespace abc="http://foo.com/foo.xsd"
> > .//abc:bar
> >
> > Then what I want is all elements foo@http://foo.com/foo.xsd.   That
means
> > that I'll select elements from this:
> >
> > <something>
> > <somethingElse>
> > <bar xmlns="http://foo.com/foo.xsd">foobar</bar>
> > </somethingElse>
> > </something>
> >
> > Just the same as this:
> >
> > <something xmlns:foo="http://foo.com/foo.xsd">
> > <somethingElse>
> > <foo:bar>foobar</foo:bar>
> > </somethingElse>
> > </something>
> >
> > So what I'm saying is that I don't care about the prefixes used in the
> > document, after all, each node has it own qname and the prefix is just
for
> > us humans.
> >
> > Am I missing the point of this discussion?  To me it seems like an
> > open/shut case.
> >
> > my 2c
> > cheers
> > dim
> >
> > -----Original Message-----
> > From: nn [mailto:nnakae@comcast.net]
> > Sent: Tuesday, 22 June 2004 4:50 AM
> > To: xmlbeans-dev@xml.apache.org
> > Subject: Re: bug fix for XPath using Namespace
> >
> > Maybe I  need to understand how these context dependent features are
used
> > in XMLBeans application.
> > I'm assuming it is used only from outside of XML docment.
> > Although you provide an exmple of XPath which is used as part of XSLT, I
> > think XMLBeans won't be used that way.
> >
> > nn
> >
> > ----- Original Message -----
> > From: "David Waite" <mass@akuma.org>
> > To: <xmlbeans-dev@xml.apache.org>
> > Sent: Monday, June 21, 2004 11:02 AM
> > Subject: Re: bug fix for XPath using Namespace
> >
> >
> > > The context of an xpath (current position, functions, variables, and
> > > namespace/prefix mappings) is a function of how the xpath expression
is
> > > used, not of the document it is operating on.
> > >
> > > -David Waite
> > >
> > > On Jun 21, 2004, at 11:33 AM, nn wrote:
> > >
> > > > Cezar,
> > > > Why is it necessary to make XPath independent from the XmlObject?
> > > > Typically XPath (XSLT) assumes XML document structure implicitly.
> > > > Then why do we need to make namespace independent from XmlObject?
> > > >
> > > > nn
> > > >
> > > >
> > > > ----- Original Message -----
> > > > From: "Cezar Andrei" <cezar@bea.com>
> > > > To: <xmlbeans-dev@xml.apache.org>
> > > > Sent: Friday, June 18, 2004 7:00 AM
> > > > Subject: RE: bug fix for XPath using Namespace
> > > >
> > > >
> > > > The problem with this approach is that the user of the selectPath
> > > > method has
> > > > to know for sure what prefixes and namespaces are used in the
> > > > XmlObject.
> > > >
> > > > I think the prefixes in xpath expressions a independent from the
ones
> > > > in the
> > > > document, so this means that the user should provide their own
prefix
> > > > resolver. This resolver can come from the same XmlObject if this is
> > the
> > > > intent, but otherwise they should be different.
> > > >
> > > > Cezar
> > > >
> > > >> -----Original Message-----
> > > >> From: nn [mailto:nnakae@comcast.net]
> > > >> Sent: Friday, June 18, 2004 5:49 AM
> > > >> To: xmlbeans-dev@xml.apache.org
> > > >> Subject: bug fix for XPath using Namespace
> > > >>
> > > >>
> > > >> Hi,
> > > >> I think it is important to remove the restriction for not
> > > >> allowing to use
> > > >> namespace in complex XPath expression.
> > > >> (s.t ./po:purchaseOrder/po:shipTo[po:name = 'Helen Zoe']" ).
> > > >>
> > > >> Since otherwise, the useful XPath (which is provided by
> > > >> JAXEN) cannot be
> > > >> used for most XML data associated with XMLSchema. I thought
> > > >> this may be a
> > > >> restriction of JAXEN, but it wasn't.
> > > >> This fix is relatively simple. I  hope this should be
> > > >> incorporated in the
> > > >> release (after reviewed by commiters and tested throughly).
> > > >>
> > > >
> > > > -
> > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:   xmlbeans-dev-unsubscribe@xml.apache.org
> > > > For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
> > > > Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/
> > > >
> > > >
> > > > -
> > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:   xmlbeans-dev-unsubscribe@xml.apache.org
> > > > For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
> > > > Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/
> > > >
> > >
> > >
> >
> - ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:   xmlbeans-dev-unsubscribe@xml.apache.org
> > > For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
> > > Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/
> > >
> >
> >
> > - ---------------------------------------------------------------------
> > To unsubscribe, e-mail:   xmlbeans-dev-unsubscribe@xml.apache.org
> > For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
> > Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/
> >
> >
> > - ---------------------------------------------------------------------
> > To unsubscribe, e-mail:   xmlbeans-dev-unsubscribe@xml.apache.org
> > For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
> > Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/
> >
>
>
> - ---------------------------------------------------------------------
> To unsubscribe, e-mail:   xmlbeans-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
> Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/
>


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


Mime
View raw message