[jdom-interest] Re: Question about Xlink with JDOM :plz help
bob mcwhirter
bob at werken.com
Sun Oct 28 06:36:45 PST 2001
First, please direct all questions to the jdom-interest at jdom.org
mailing list.
Second, I'm not certain you understand how XLink works. As I
understand it (which could certainly be incorrect), it only provides
a syntax for expressing the semantic link between two resources.
Your first example seems to use XLink correctly. But, there is
no provision in the XLink spec that I'm aware of, to transform
it into the second document through traversing the link.
Looks like you're more interested in XInclude type of stuff, but
unfortunately, XInclude only allows inclusion of entities which
aren't Attributes or Namespaces. So, even with XInclude, you
would not be able produce your 2nd document.
You application could, though, follow the xlink:href, and
apply application-specific logic to the target, and do whatever
it is you need to do with that information.
But, that's application-specific logic.
As far as werken.xpath or Jaxen support, there really is none.
An XPointer implementation if what you need for resolving the
xlink:href end-point, and Jaxen doesn't support XPointer at
this time.
-bob
On Sun, 28 Oct 2001, ploy Nanticha wrote:
> This is the example of the job that I have to accomplish...Please suggest me about this..
>
> I have a xml file like this :
>
> <Supplier ID="1005" xlink:href=id.xml#('id') >Alien widget</Supplier>
>
> I keep the information (about name and role) that I want to use in other xml file called "id.xml" at 'id' section
>
> The result that I want is something like this :
>
> <Supplier ID="1005" name="JOB" Role="My">Alien widget</Supplier>
> Could you suggest me how to do this with JDOM please?
> Thank you
> Regards,
> Nanticha Kiatibut
>
>
>
>
> bob mcwhirter <bob at werken.com> wrote:
> On Thu, 25 Oct 2001, ploy Nanticha wrote:
>
> > 1. I want to use xlink to link information from another xml file ,
> > Can I do it with Werken.xpath package?
>
> Couple of points:
>
> 1) werken.xpath is basically deprecated at this point, in favor
> of Jaxen (http://jaxen.org/). Much better XPath compliance.
>
> 2) xlink, as I understand it, is pretty much just a syntax for
> identifying links between resources. Dunno how an xpath
> engine would assist you there.
>
> I have been toying with the idea of building an XInclude engine
> on top of Jaxen, but we don't have XPointer support built in
> yet, so it'll be a while. Plus, XInclude has different semantics
> than XLink.
>
> Though, as in all cases, instead of just asking about a particular
> technology, if you instead give us an example of what it is you're
> trying to accomplish (the goal you're trying to reach), we may be
> able to help you out a tad more. Goal-directed design tends to
> work better than task-directed methods.
>
> -bob
>
>
>
> ---------------------------------
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
More information about the jdom-interest
mailing list