Return-Path: Delivered-To: apmail-xml-general-archive@xml.apache.org Received: (qmail 33714 invoked by uid 500); 4 Jun 2003 19:56:03 -0000 Mailing-List: contact general-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: general@xml.apache.org Delivered-To: mailing list general@xml.apache.org Received: (qmail 33654 invoked from network); 4 Jun 2003 19:56:02 -0000 Message-ID: <003401c32ad3$69829f20$1100a8c0@blackdragon> From: "Stefan Pietschmann" To: Subject: java - xml - xpointer problem Date: Wed, 4 Jun 2003 21:55:58 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0025_01C32AE4.14E94D90" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ------=_NextPart_000_0025_01C32AE4.14E94D90 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable hi guys, i already asked a similar question in the cocoon-users mailing list, so = please excuse this, but since i got no answers and it wasn't really a = cocoon specific question i'm gonna place it here once more...changed a = bit. I'm writing a Transformer for Cocoon... as input i have the DOM = representation of a document. Let's say a part of this document is .... I went Home ... Stored in a variable i have the id of a node, in this case "sometext". = Furthermore I have a variable called pointer, which looks like = "string-range(.,"Home")[1] ..something like this. It should be a proper = XPointer expression, I can change that to whatever I want though. Now the goal of the Transformer is to write an anchor around the string = pointed to - "Home" in this case - which occurs in the node defined. I = can make the span the context node and Java allows me to insert nodes = before and after this one.. but how can i write an anchor around the = specified string within this node? Of course I could get the string, iterate through it and search for the = word etc, but that would be a pain, esp. since there could be 18 = instances and I would want the 17th etc. Actually I'd like to use XPointer, so that some function returns the = specified string-range in the node, and I can surround it with an = tag... that's what I thought ;) So, is there an XPointer implementation that allows me that .. or how = would you solve that problem? Thanx, Stefan Pietschmann ------=_NextPart_000_0025_01C32AE4.14E94D90 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
hi guys,
 
i already asked a similar question in = the=20 cocoon-users mailing list, so please excuse this, but since i got no = answers and=20 it wasn't really a cocoon specific question i'm gonna place it here once = more...changed a bit.
 
I'm writing a Transformer for Cocoon... = as input i=20 have the DOM representation of a document. Let's say a part of this = document=20 is
 
....
<img ..../>
<span = id=3D"sometext">
    I went = Home
</span>
...
 
Stored in a variable i have the id of a = node, in=20 this case "sometext". Furthermore I have a variable called pointer, = which looks=20 like "string-range(.,"Home")[1] = ..something=20 like this. It should be a proper XPointer expression, I can change that = to=20 whatever I want though.
Now the goal of the Transformer is to = write an=20 anchor around the string pointed to - "Home" in this case - which occurs = in the=20 node defined. I can make the span the context node and Java = allows me=20 to insert nodes before and after this one.. but how can i write an = anchor around=20 the specified string within this node?
Of course I could get the string, = iterate through=20 it and search for the word etc, but that would be a pain, esp. since = there could=20 be 18 instances and I would want the 17th etc.
Actually I'd like to use XPointer, so = that some=20 function returns the specified string-range in the node, and I can = surround it=20 with an <a> tag... that's what I thought ;)
So, is there an XPointer implementation = that allows=20 me that .. or how would you solve that problem?
 
Thanx,
Stefan = Pietschmann
------=_NextPart_000_0025_01C32AE4.14E94D90--