f

#### XSLT Extract Text from Nodes

Hello,

I am new to the concept of XSL and am looking for some assistance.

Take the following XML document:

<binder>
<author>Greg</author>
<notes>
<time>11:45</time>
<content>
This would be some content... every once in a while you may run
into
<heading>A Heading!</heading>
Which could be followed by more content... and possible
<heading>More Headings.</heading>
and even more content!
</content>
</notes>
</binder>

What I would like to do is to be able to extract the value of the
<content> node, and have special formatting for the headings.

When I do something like:

<xsl:value-of select="content" />

I receive the data within <content> - including the values of the
nested <heading> nodes, but what I really want to be able to do is do
is to have XSLT read the text of the <content> node until a <heading>
node is reached, at which point the value of the heading node is
formatted correctly and displayed, and then continued by the text of
the <content> node after the <heading> until another <heading> is
reached... etc etc...

Could someone give me some pointers as to how this can be accomplished?


 0
10/10/2006 5:31:33 PM
comp.text.xml 8781 articles. 0 followers.

9 Replies
690 Views

Similar Articles

[PageSpeed] 57


gregmcmullinjr@gmail.com wrote:

>     <content>
>       This would be some content... every once in a while you may run
> into
>       <heading>A Heading!</heading>
>       Which could be followed by more content... and possible
>       <heading>More Headings.</heading>
>       and even more content!
>     </content>

> What I would like to do is to be able to extract the value of the
> <content> node, and have special formatting for the headings.

Use templates and xsl:apply-templates e.g.

<xsl:template match="content">
<div>
<xsl:apply-templates/>
</div>
</xsl:template>

<xsl:template match="heading">
<h1>
<xsl:apply-templates/>
</h1>
</xsl:template>

There is a built-in template for text nodes
<http://www.w3.org/TR/xslt#built-in-rule>
so you don't have to do anything for them, they end up in the result
tree anyway with the above approach.

--

Martin Honnen
http://JavaScript.FAQTs.com/

 0
mahotrash (2052)
10/10/2006 5:37:46 PM
Thanks for your quick reply Martin,

This has brought me closer to what I would like to accomplish, however
I now have the following issue.

I was using the xsl:value-of element with disable-output-escaping="yes"
to produce HTML formatted text in the browser screen.  You see within
the <content> node there may be HTML that should be displayed as such.
Your method produces all of the text in the correct order and formatted
according to tag name, but produces HTML tags which should be hidden.

ie.

<content>
There may be some <i>italicized</i> text...
<heading>Maybe even <u>formatting in a heading</u></heading>
...
</content>

Is there some way to overcome this?

Martin Honnen wrote:
> gregmcmullinjr@gmail.com wrote:
>
>
> >     <content>
> >       This would be some content... every once in a while you may run
> > into
> >       <heading>A Heading!</heading>
> >       Which could be followed by more content... and possible
> >       <heading>More Headings.</heading>
> >       and even more content!
> >     </content>
>
>
> > What I would like to do is to be able to extract the value of the
> > <content> node, and have special formatting for the headings.
>
> Use templates and xsl:apply-templates e.g.
>
>    <xsl:template match="content">
>      <div>
>        <xsl:apply-templates/>
>      </div>
>    </xsl:template>
>
>    <xsl:template match="heading">
>      <h1>
>        <xsl:apply-templates/>
>      </h1>
>    </xsl:template>
>
> There is a built-in template for text nodes
>    <http://www.w3.org/TR/xslt#built-in-rule>
> so you don't have to do anything for them, they end up in the result
> tree anyway with the above approach.
>
>
> --
>
> 	Martin Honnen
> 	http://JavaScript.FAQTs.com/


 0
10/10/2006 6:05:50 PM
I should say that the HTML tags within my XML document are stored as
entities (at least the < character is)  i.e.

<content>
This is some &lt;i>italicized&lt;/i> text...
...
</content>

Thanks.

gregmcmulli...@gmail.com wrote:
> Thanks for your quick reply Martin,
>
> This has brought me closer to what I would like to accomplish, however
> I now have the following issue.
>
> I was using the xsl:value-of element with disable-output-escaping="yes"
> to produce HTML formatted text in the browser screen.  You see within
> the <content> node there may be HTML that should be displayed as such.
> Your method produces all of the text in the correct order and formatted
> according to tag name, but produces HTML tags which should be hidden.
>
> ie.
>
> <content>
>   There may be some <i>italicized</i> text...
>   <heading>Maybe even <u>formatting in a heading</u></heading>
>   ...
> </content>
>
> Is there some way to overcome this?
>
> Martin Honnen wrote:
> > gregmcmullinjr@gmail.com wrote:
> >
> >
> > >     <content>
> > >       This would be some content... every once in a while you may run
> > > into
> > >       <heading>A Heading!</heading>
> > >       Which could be followed by more content... and possible
> > >       <heading>More Headings.</heading>
> > >       and even more content!
> > >     </content>
> >
> >
> > > What I would like to do is to be able to extract the value of the
> > > <content> node, and have special formatting for the headings.
> >
> > Use templates and xsl:apply-templates e.g.
> >
> >    <xsl:template match="content">
> >      <div>
> >        <xsl:apply-templates/>
> >      </div>
> >    </xsl:template>
> >
> >    <xsl:template match="heading">
> >      <h1>
> >        <xsl:apply-templates/>
> >      </h1>
> >    </xsl:template>
> >
> > There is a built-in template for text nodes
> >    <http://www.w3.org/TR/xslt#built-in-rule>
> > so you don't have to do anything for them, they end up in the result
> > tree anyway with the above approach.
> >
> >
> > --
> >
> > 	Martin Honnen
> > 	http://JavaScript.FAQTs.com/


 0
10/10/2006 6:10:12 PM
I have found a solution.  The following is the build in template for
text nodes:

<xsl:template match="text()|@*">
<xsl:value-of select="."/>
</xsl:template>

It can be overridden simply by creating a new custom template, which I
did as the following:

<xsl:template match="text()|@*">
<xsl:value-of select="." disable-output-escaping="yes"/>
</xsl:template>

The result is that the HTML in the text nodes outputs as desired.

gregmcmullinjr@gmail.com wrote:
> I should say that the HTML tags within my XML document are stored as
> entities (at least the < character is)  i.e.
>
> <content>
>   This is some &lt;i>italicized&lt;/i> text...
>   ...
> </content>
>
> Thanks.
>
>
> gregmcmulli...@gmail.com wrote:
> > Thanks for your quick reply Martin,
> >
> > This has brought me closer to what I would like to accomplish, however
> > I now have the following issue.
> >
> > I was using the xsl:value-of element with disable-output-escaping="yes"
> > to produce HTML formatted text in the browser screen.  You see within
> > the <content> node there may be HTML that should be displayed as such.
> > Your method produces all of the text in the correct order and formatted
> > according to tag name, but produces HTML tags which should be hidden.
> >
> > ie.
> >
> > <content>
> >   There may be some <i>italicized</i> text...
> >   <heading>Maybe even <u>formatting in a heading</u></heading>
> >   ...
> > </content>
> >
> > Is there some way to overcome this?
> >
> > Martin Honnen wrote:
> > > gregmcmullinjr@gmail.com wrote:
> > >
> > >
> > > >     <content>
> > > >       This would be some content... every once in a while you may run
> > > > into
> > > >       <heading>A Heading!</heading>
> > > >       Which could be followed by more content... and possible
> > > >       <heading>More Headings.</heading>
> > > >       and even more content!
> > > >     </content>
> > >
> > >
> > > > What I would like to do is to be able to extract the value of the
> > > > <content> node, and have special formatting for the headings.
> > >
> > > Use templates and xsl:apply-templates e.g.
> > >
> > >    <xsl:template match="content">
> > >      <div>
> > >        <xsl:apply-templates/>
> > >      </div>
> > >    </xsl:template>
> > >
> > >    <xsl:template match="heading">
> > >      <h1>
> > >        <xsl:apply-templates/>
> > >      </h1>
> > >    </xsl:template>
> > >
> > > There is a built-in template for text nodes
> > >    <http://www.w3.org/TR/xslt#built-in-rule>
> > > so you don't have to do anything for them, they end up in the result
> > > tree anyway with the above approach.
> > >
> > >
> > > --
> > >
> > > 	Martin Honnen
> > > 	http://JavaScript.FAQTs.com/


 0
10/10/2006 6:49:23 PM
Please don't top-post.

gregmcmullinjr@gmail.com wrote:
> Martin Honnen wrote:
> > gregmcmullinjr@gmail.com wrote:
> > >     <content>
> > >       This would be some content... every once in a
> > >       while you may run into
> > >       <heading>A Heading!</heading>
> > >       Which could be followed by more content... and
> > >       possible
> > >       <heading>More Headings.</heading>
> > >       and even more content!
> > >     </content>
> >
> > Use templates and xsl:apply-templates e.g.
> >
> >    <xsl:template match="content">
> >      <div>
> >        <xsl:apply-templates/>
> >      </div>
> >    </xsl:template>
> >
> >    <xsl:template match="heading">
> >      <h1>
> >        <xsl:apply-templates/>
> >      </h1>
> >    </xsl:template>
>
> This has brought me closer to what I would like to
> accomplish, however I now have the following issue.
>
> I was using the xsl:value-of element with
> disable-output-escaping="yes" to produce HTML formatted
> text in the browser screen.  You see within the <content>
> node there may be HTML that should be displayed as such.
> Your method produces all of the text in the correct order
> and formatted according to tag name, but produces HTML
> tags which should be hidden.
>
> ie.
>
> <content>
>   There may be some <i>italicized</i> text...
>   <heading>Maybe even <u>formatting in a
>   heading</u></heading>
>   ...
> </content>
>
> Is there some way to overcome this?
>
> I should say that the HTML tags within my XML document
> are stored as entities (at least the < character is) i.e.
>
> <content>
>   This is some &lt;i>italicized&lt;/i> text...
>   ...
> </content>

Don't do that, it seems to lead to innumerable problems.
Store you mark-up as XML instead:

<content>
This is some <i>italicized</i> text...
...
</content>

....and use the identity transformation to convert it into
HTML:

<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>

This also has the virtue of fitting neatly with the
solution for your original problem that Martin Honnen has
proposed.

You might also need to write exclusion templates for some
nodes, but that's hardly a problem.

--
roy axenov


 0
r_axenov (54)
10/10/2006 6:54:38 PM
Not sure what a top-post is...

While I see what your saying Roy, the problem is that the contained
HTML is not necessarily well formed because of the way that its formed
at this time.  Perhaps when I have figured out how to force it to be
well formed I can use this solution.

Thanks.

roy axenov wrote:
> Please don't top-post.
>
> gregmcmullinjr@gmail.com wrote:
> > Martin Honnen wrote:
> > > gregmcmullinjr@gmail.com wrote:
> > > >     <content>
> > > >       This would be some content... every once in a
> > > >       while you may run into
> > > >       <heading>A Heading!</heading>
> > > >       Which could be followed by more content... and
> > > >       possible
> > > >       <heading>More Headings.</heading>
> > > >       and even more content!
> > > >     </content>
> > >
> > > Use templates and xsl:apply-templates e.g.
> > >
> > >    <xsl:template match="content">
> > >      <div>
> > >        <xsl:apply-templates/>
> > >      </div>
> > >    </xsl:template>
> > >
> > >    <xsl:template match="heading">
> > >      <h1>
> > >        <xsl:apply-templates/>
> > >      </h1>
> > >    </xsl:template>
> >
> > This has brought me closer to what I would like to
> > accomplish, however I now have the following issue.
> >
> > I was using the xsl:value-of element with
> > disable-output-escaping="yes" to produce HTML formatted
> > text in the browser screen.  You see within the <content>
> > node there may be HTML that should be displayed as such.
> > Your method produces all of the text in the correct order
> > and formatted according to tag name, but produces HTML
> > tags which should be hidden.
> >
> > ie.
> >
> > <content>
> >   There may be some <i>italicized</i> text...
> >   <heading>Maybe even <u>formatting in a
> >   heading</u></heading>
> >   ...
> > </content>
> >
> > Is there some way to overcome this?
> >
> > I should say that the HTML tags within my XML document
> > are stored as entities (at least the < character is) i.e.
> >
> > <content>
> >   This is some &lt;i>italicized&lt;/i> text...
> >   ...
> > </content>
>
> Don't do that, it seems to lead to innumerable problems.
> Store you mark-up as XML instead:
>
>   <content>
>     This is some <i>italicized</i> text...
>     ...
>   </content>
>
> ...and use the identity transformation to convert it into
> HTML:
>
>   <xsl:template match="@*|node()">
>     <xsl:copy>
>       <xsl:apply-templates select="@*|node()"/>
>     </xsl:copy>
>   </xsl:template>
>
> This also has the virtue of fitting neatly with the
> solution for your original problem that Martin Honnen has
> proposed.
>
> You might also need to write exclusion templates for some
> nodes, but that's hardly a problem.
>
> --
> roy axenov


 0
10/10/2006 7:29:13 PM
gregmcmullinjr@gmail.com schrieb:
> roy axenov wrote:
>> Please don't top-post.

> Not sure what a top-post is...

Then ask a search engine. It will lead you to some documents like
<http://www.catb.org/~esr/jargon/html/T/top-post.html>.

--
Johannes Koch
Spem in alium nunquam habui praeter in te, Deus Israel.
(Thomas Tallis, 40-part motet)

 0
koch8601 (279)
10/10/2006 9:33:35 PM

gregmcmullinjr@gmail.com wrote:

> It can be overridden simply by creating a new custom template, which I
> did as the following:
>
> <xsl:template match="text()|@*">
>   <xsl:value-of select="." disable-output-escaping="yes"/>
> </xsl:template>
>
> The result is that the HTML in the text nodes outputs as desired.

If that works for you then you can use it. But you should be aware that
disable-output-escaping support is an optional feature during
serialization of the result tree meaning it might not be supported at
all by an XSLT processor or it is not supported when you don't serialize
the result tree (e.g. when you chain transformation or e.g. in a browser
like Mozilla where the result tree is being rendered directly without
any serialization happening).

--

Martin Honnen
http://JavaScript.FAQTs.com/

 0
mahotrash (2052)
10/11/2006 1:34:25 PM
I think this will suffice for my needs as I am doing the
transformations on the server.

Thanks again.

Martin Honnen wrote:
> gregmcmullinjr@gmail.com wrote:
>
>
> > It can be overridden simply by creating a new custom template, which I
> > did as the following:
> >
> > <xsl:template match="text()|@*">
> >   <xsl:value-of select="." disable-output-escaping="yes"/>
> > </xsl:template>
> >
> > The result is that the HTML in the text nodes outputs as desired.
>
> If that works for you then you can use it. But you should be aware that
> disable-output-escaping support is an optional feature during
> serialization of the result tree meaning it might not be supported at
> all by an XSLT processor or it is not supported when you don't serialize
> the result tree (e.g. when you chain transformation or e.g. in a browser
> like Mozilla where the result tree is being rendered directly without
> any serialization happening).
>
> --
>
> 	Martin Honnen
> 	http://JavaScript.FAQTs.com/


 0
10/11/2006 2:48:02 PM
 Reply:

Similar Artilces:

XSLT Select nodes without text-node children whose names starts with specifix text
Question on XSL expression Got this XML: <Body> <Page> <Line no="9" detail="true"> <onefield>onefieldstext</onefield> <twofield>twofieldstext</twofield> </Line> <Line no="10" detail="true"> <onefield>onefieldstext</onefield> <fgman9>fgmanfieldstext</fgman9> <twofield>twofieldstext</twofield> </Line> <Line no="11" detail="true"> <onefield>onefieldstext</onefield> <twofield>twofieldstext</twofield> </Line> <Line no="12" detail="true"> <onefield>onefieldstext</onefield> <twofield>twofieldstext</twofield> </Line> <Line no="13" detail="true"> <onefield>onefieldstext</onefield> <fgman5>fgmanfieldstext</fgman5> <twofield>twofieldstext</twofield> </Line> <Line no="14" detail="true"> <onefield>onefieldstext</onefield> <twofield>twofieldstext</twofield> </Line> </Page> </Body> I would select the <Line/> nodes without text-node children whose names is starting with "fgman" - in this example it is all <Line/> _except_ <fgman9/> and <fgman5/> in <Line/> with @no of 10 and 13. I know that this works: &...

extracting text from an XML node
Hi, suppose i get the simple xml sample: <foo> 1 <bar>2</bar> 3 </foo> Now suppose i want to extract all the text of only the 'foo' node, ie expected result is '1 3'. I tried both <xsl:template match="foo"> <xsl:value-of select="text()" /> </xsl:template> and <xsl:template match="foo"> <xsl:value-of select="." /> </xsl:template> but the former lead to '1' and the latter to '1 2 3' (using xsltproc & firefox). What did i missed ? thanks, -Nicolas nicolas.edel@gmail.com wrote: > Now suppose i want to extract all the text of only the 'foo' node That isn't a built-in concept; you have to recast it as "all the text nodes which are immediate children of the 'foo' node". (The built-in text value of an element, as you discovered, is the value of all text contained in it, directly or indirectly). Note too that the whitespace (line breaks and indentation) will be part of the the text nodes unless you explicitly strip that away. <xsl:value-of select="text()" /> didn't work because value-of returns the contents of only the first matching node. This is one case where xsl:for-each is appropriate, to explicitly iterate through the text children. -- Joe Kesselman / Beware the fury of a patient man. -- John Dryden On Nov 30, 12:34 am, Joseph Kesselman <kesh...

text + text
What is "text + text" supposed to do right now? It doesn't seem very useful to me. What about making "text + text" as an equivalent for "text || text"? Most strongly-typed programming languages do this. And MS SQL Server too, I think (CMIIW). -- dave ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org Am Freitag, 8. Oktober 2004 12:57 schrieb David Garamond: > What is "text + text" supposed to do right now? Nothing. > What about making "text + text" as an equivalent for "text > || text"? Most strongly-typed programming languages do this. And MS SQL > Server too, I think (CMIIW). What would this gain except for bloat? It's not like SQL is utterly compatible with any programming language; users will still have to learn all the operators anyway. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match Peter Eisentraut wrote: >>What is "text + text" supposed to do right now? > > Nothing. Then are these bugs? (7.4.5 and 8.0.0beta1 give same results). Frankly, the current behaviour is quite strange to me. ------------------ =...

text-text
Wondering how what I input to my UTF-8 terminal gets passed along through my patched [1] trn ... Cyrillic: А Б В Г Д Е Ж З И Й К Л М Н О П а б в г д е ж з и й к л м н о п IPA: ᴀ ᴁ ᴂ ᴃ ᴄ ᴅ ᴆ ᴇ ᴈ ᴉ ᴊ ᴋ ᴌ ᴍ ᴎ ᴏ ɀ Ɂ ɂ Ƀ Ʉ Ʌ Ɇ ɇ Ɉ ɉ Ɋ ɋ Ɍ ɍ Ɏ ɏ [1] https://groups.google.com/d/msg/comp.sys.raspberry-pi/7Z37Hdrm0DM/6aqD-reXFzAJ ...

How to extract the plain text from a rich text ?
Hi everybody ! I can't find how to get a wxstring containing the plain text from a wxstring containing rich text. Does anybody how to do that ? Thanks ! ...

xml wrongly views as text extracted from the xml tags
we have a java framework, where we feed a request xml. this request xml is forwarded through the framework, tomcat and axis, for the backend processing, and the processing results are again received by the internet explorer, after they are transformed with an xslt by the framework. now the problem that we are facing is like - the explorer extracts the text inside all xml tags of the response xml and shows it as simple text. but, if you view the source of the 'text', it will show it all as well-formed xml. moreover, if you save the source as an xml file, and again open it through internet explorer, it will show the xml in proper way. i have tried using firefox, processing with xml spy, but with same results... has somebody experienced similar problem before??? i wonder what can be wrong in this case, and would be thankful for any pointers as to what can be the cause and solution to this. Thanks in advance, Shreyas Hi all, Finally i got what was the problem. it was because the response xml contained a <Title> </Title> tag in it. and dont know why/how, but IE was treating it as an HTML tag. i noticed that the browser window title was indeed "Mr" which is the text enclosed by the Title element. one more weird thing i noticed was that if i moved the <xsl:apply-templates> line for the tag downwords after one more template application, it was showing the xml properly alongwith the <Title> element, and not treating it as an HTML tag...

XML DOM: XML/XHTML inside a text node
In my program, I get input from the user and insert it into an XHTML document. Sometimes, this input will contain XHTML, but since I'm inserting it as a text node, xml.dom.minidom escapes the angle brackets ('<' becomes '&lt;', '>' becomes '&gt;'). I want to be able to override this behavior cleanly. I know I could pipe the input through a SAX parser and create nodes to insert into the tree, but that seems kind of messy. Is there a better way? Thanks. On Thu, 2 Nov 2005 noahlt@gmail.com wrote: > In my program, I get input from the us...

xslt help needed with element nodes embedded in text node
I'm but an amateur with xsl stylesheets. I need some help to the output of text nodes with embedded element nodes like the following: <uf><ns>This</ns> example</uf> <uf>Another <ns>This</ns> example</uf> <uf>Another <ns>This</ns></uf> I need to output the ns strings in italics. <xsl:apply-templates select="./uf" /> <xsl:template match="ns"> <i><xsl:value-of select="." /></i> </xsl:template> As long as the xml file is exported in lines as above the output is ok: "This example". (In this email I don't indicate the italicised part string.) But lately the document server hosting the application that contains xml files of the sort above changed the export of xml files. Now there are line breaks at each new element boundary: <uf> <ns>This</> example </uf> With my xsl code I get an additional space at the beginning and the end of the phrase: " This example ". I tried to get rid of them with <xsl:template match="text()"> <xsl:value-of select="normalize-space()" /> </xsl:template> But this results in "Thisexample". What is to be done? (There is no option to substitute the mandatory spaces with &#160;). Volker I tried <xsl:strip-space elements="uf" />. It doesn't help either. Volker Volker Le...

file command: "XML document text" vs "XML document text"
I've just used the file command on four files of RDF-XML with the following output: augtfidf.rdf: XML document text kyoto.rdf: XML document text stuff.rdf: XML document text tfidf.rdf: XML document text What does it mean that one of them has an extra space between "XML" and "document"? -- The kid's a hot prospect. He's got a good head for merchandising, an agent who can take you downtown and one of the best urine samples I've seen in a long time. [Dead Kennedys t-shirt] On 16.10.2012 16:06, Adam Funk wrote: > I've just used the file command on four files of RDF-XML with the > following output: > > augtfidf.rdf: XML document text > kyoto.rdf: XML document text > stuff.rdf: XML document text > tfidf.rdf: XML document text > > What does it mean that one of them has an extra space between "XML" > and "document"? Hard to tell without further information. What does file *.rdf | od -c show you? Janis Janis Papanagnou wrote: > On 16.10.2012 16:06, Adam Funk wrote: >> I've just used the file command on four files of RDF-XML with the >> following output: >> >> augtfidf.rdf: XML document text >> kyoto.rdf: XML document text >> stuff.rdf: XML document text >> tfidf.rdf: XML document text >> >> What does it mean that one ...

Extract text with style from rich text fields
Hi everybody, Somebody know how can i extract text with its styles (bold, tables, pictures,etc) from a RicText field with LotusScript. I use the method richtextField.AppendText(textOfRitem) but only the text without his presentation is extracted. I put the extracted text in other RichText field (to create a report of all documents present in the base). in the follow line, the method that i use: Forall ch_action In doc.GetItemValue("RTField") Call rtitem.AppendText(ch_action) Call rtitem.AddNewline(2) End Forall Thank you Eric Mazzone, Hi Eric, a si...

Extract Text from a Checkbox and add text between values
Hi all,=20 FM 11Adv for widnows here :) I have a checkbox list such as: Apple, Banana, Orange, Lemon Now, I would like to add another text value to each selected value of the c= heckbox, in real time. So that when the user select "Orange" in the list, t= here will be a Custom dialog box that will let her to insert an adjective (= i.e. "Good", "Bad, "tasty" or whatever she likes). Finally, I would like to report in a second field the combination of checke= d value (from the checkbox) and the free adjective I have let the user add,= to have: "Orange good", "apple Bad", "lemon tasty" etc... I am trying to play with triggers so that the custom dialog box pops up as = far as a value in the checkbox is checked (this works). Unfortunately, the free text is added to the END of the checked values, and= I end up with something like:=20 Orange, Apple, Lemon good (or bad or tasty, actually the new added free tex= t erases the preceding choices instead of adding up)=20 Might you please help ? It would be nice to define a solution that does not= use script triggers as well, if at all possible... Thanks a lot ! Diego Op 2-9-2013 20:18, Diego B schreef: > Hi all, > > FM 11Adv for widnows here :) > > I have a checkbox list such as: > Apple, Banana, Orange, Lemon > > Now, I would like to add another text value to each selected value of the checkbox, in re...

Script to extract portions of text from a text file
I had a need to extract portions of text (delimited by fixed patterns) from a large text file. Here's a shell script that I wrote for this purpose. Kindly suggest a more "elegant" way to do the same: Thanks, Bhat #!/bin/ksh # Script to extract portions of text from a text file # # #set -x if [ "$#" -lt "3" ] then echo "usage$0: <input-file> <begin-pattern> <end-pattern>" exit 1 fi if [ ! -f "$1" ] then echo "File$1 does not exist" exit 2 fi if [ ! -r "$1" ] then echo "Error reading file$1...

Getting kind of abstract text snippets from text nodes
Hi everybody, I am about implementing a little search engine that searches a phrase over xml text nodes. I got that all working fine but what I want as the results is not the complete text of the textnode, I would like to make an abstract like result list (such output that you get with google searches. For eg .... I am the <b>substring</b> from a complete text node ... where "substring" is the search term. The problem is simple (I think): I want to extract all the text parts of the complete text node, where search searchterm is highlighted, surrounded by the text like 30 characters. I found an intersting post "cut down text" which is almost that what I am looking for, but there the text is just trimmed by x characters. Is anybody here, that has an "elegant" way to solve that or some hints that get me to the solution? I am not able to use regex (would be nice though) My parser is Sablotron so I am restricted to the functions that I get. (1.0). Any help is greatly appreciated. regards, Andreas W Wylach Think about dividing the text into three parts: before your target, the target itself, and after the target. Process each appropriately. If you want to report multiple instances within the same block of text, look at the standard examples of recursive text processing. -- () ASCII Ribbon Campaign | Joe Kesselman /\ Stamp out HTML e-mail! | System architexture and kinetic poetry "Andreas W. Wylach" <aw@ioc...

ghostscript PDF page extraction, leaving text as text
Ghostscript may be used to extract pages from a PDF file with a command like this: gs -sDEVICE=pdfwrite \ -dNOPAUSE -dBATCH -dSAFER \ -dFirstPage=48 -dLastPage=48 \ -sOutputFile=onepage.pdf input.pdf The problem is, while that page looks the same as the original in a PDF reader, it seems to be an image rather than an "object" representation. That is, open the extracted PDF in something like Acrobat or PDF XChange Viewer and "search" and "text selection" work, whereas in the extracted one neither function works. Presumably this is because the text has been r...

XSLT Delimited Text Node
Is there a way in XSLT to match on numbers that are delimited by a character or space in a text node? Mike King wrote: > Is there a way in XSLT to match on numbers that are delimited by a character > or space in a text node? XSLT 2.0 can do that nicely with the tokenize XPath 2.0 function e.g. with the input being <?xml version="1.0" encoding="UTF-8"?> <root> <data-list>1 2 3 4 5</data-list> </root> and the stylesheet <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="xml" indent="yes" /> <xsl:template match="@* | node()"> <xsl:copy> <xsl:apply-templates select="@* | node()" /> </xsl:copy> </xsl:template> <xsl:template match="data-list"> <xsl:copy> <xsl:for-each select="tokenize(., '\s+')"> <data><xsl:value-of select="." /></data> </xsl:for-each> </xsl:copy> </xsl:template> </xsl:stylesheet> the result using Saxon 8.3 is <?xml version="1.0" encoding="UTF-8"?> <root> <data-list> <data>1</data> <data>2</data> <data>3</data> <data>4</dat...

Text from required text box to read-only text box
Hello, I am fairly new to JavaScript and its use in Acrobat Professional. My situation is this: I have a form with a text box field which is required for the user to enter his/her name. I would like the required text box to display the name in all caps. I also need the user's name to appear in a read-only text box later in the form, which I would like to have the first letter of the user's first, middle initial, and last names to be capitalized. I would also like to have all required fields on the form highlighted in yellow, but the highlighting not printed. Lastly, I would like the...

Pages
I have a titel-textfield over a pic (headline) , text is black, background for text transparent. A second textfield should overlapp the first textline..... When i arrange the second field with the same settings like the first, the first text disappear... How can i do, that the second text overpapps the first, all over the pic. Any help appreciated! Thanks for replies! I am german and hope that the engish speaking people understand my problem! Soory! Gerd In article <611db9e2-b085-4fe5-907a-ca714b0c32dd@m74g2000hsh.googlegroups.com>, hurlebaus <gerd.schenk@freenet.de> wrote:...

text node has text but won't render
This renders in Firefox perfectly well but the text in the red box remains invisible. The program is a subset of a larger and doesn't do much. but even after cutting out all the unneccessary stuf, I still can't get it to work!! Cheers, Greg =================== <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg" > <xhtml:head> <xhtml:title> Intermingled XHTML and SVG </xhtml:title> <xhtml:script type="text/javascript" language="JavaScript"><![CDATA[ function gogo(evt){ var targetObj = evt.target; //The object that received the event var targetDoc = targetObj.ownerDocument; //Owner document var wg = document.getElementById("SVGroot"); var lg = document.getElementById("labelz"); //label labelBox= targetDoc.createElementNS("http://www.w3.org/2000/svg", "svg:rect"); labelBox.setAttributeNS(null, "id", "label1"); labelBox.setAttributeNS(null, "fill", "red"); labelBox.setAttributeNS(null, "fill-opacity", 1); labelBox.setAttributeNS(null, "x", 700); labelBox.setAttributeNS(null, "y", 400); labelBox.setAttributeNS(null, "width", 200); labelBox.setAttributeNS(null, "height", 20); labelBox.setAttributeNS(null, "visibility", "visible"); lg.appendC...

text 2 text
I'm rather new to ustation and am having trouble finding replacements for all of my Acad lisp routines. One that I'd like to find changes a selected text string to read like the second selected text string. I realize this can all be done in the text editor but it's not all that quick. Does anyone know of a macro or mdl which can handle this task? Thanks in advance.---Calvin I don't know of any application that will do what you describe, but have you looked at Edit > Find/Replace text? You may also find Bentley's discussion groups of assistance. Over there you can meet other users of Bentley products, exchange ideas, and discuss a wide range of technical subjects. These groups are an excellent technical resource for all users of Bentley products and services. Hope to see you there! For more information take a peek at this page: http://selectservices.bentley.com/discussion/index.htm -- Best Regards, Inga Morozoff [Bentley] www.askinga.com "jgonzales24" <jgonzales24@cox.net> wrote in message news:xcLMb.13975$zs4.2376@fed1read01... > I'm rather new to ustation and am having trouble finding replacements for > all of my Acad lisp routines. One that I'd like to find changes a selected > text string to read like the second selected text string. I realize this > can all be done in the text editor but it's not all that quick. Does anyone > know of a macro or mdl whi... Surrounding text with text I was wondering if it was possible to surround a text body with text like so: +--------------+ |ABCDEFGHIJKLM | |H N| |A Main Body O| |L Text goes P| |B here Q| |-=+_ZYXWVUTSR | | | | | | | | | +--------------+ This seems far-fetched, but just curious. I suppose that I could just move stuff around by hand in the GIMP later on, but there's probably a {better,more {extensible,clean}} way of doing it from (La)TeX. -FreeSmith ptjm@interlog.com (Patrick TJ McPhee) wrote in message news:<bffbhe$per$1@news.eusc.inter.net>... > Peter Flynn had an example like that, which he either posted here or > posted a link here. It was something to do with a certificate -- try > searching for his name and that word in google. > > It wouldn't be hard to do with metapost. I have a macro called `pathalong' > which puts text along an arbitrary path. Well, it's been a while, but I finally finished it. It's a little job I was doing for an upcoming wedding. At any rate, I used pstricks to make the text go along a path, along with a couple of hacks for sizing (from graphicx) and kerning along the line (from soul). Here's the code (don't laugh): CAUTION:THIS CODE MAY MAKE YOU WRETCH ---SNIP--- \documentclass{article} \usepackage{graphicx} \usepackage{pstricks,pst-text,nopageno} \usepackage[width=8.5in]{geometry} \usepackage{soul} \begin{document} \thispagestyle{empty} \set... XSLT: concatenating selected text nodes in XSLT, if I want to concatenate _all_ the child text nodes, I can just do <xsl:value-of select="."> however, if I want to select and concatente only _some_ of the text nodes. for instance <xsl:value-of select=".//foo/text()"> this doesn't work as it just takes the first element in the node set. Is there any way of achieving this without using <xsl:for-each> to explicitly loop round them all? TIA Andy use copy-of not value-of David "David Carlisle" <davidc@nag.co.uk> wrote in message news:yg4r7ktpnzq.fsf@penguin.nag.co.uk... > > use copy-of not value-of > worked a treat - thanks david. > > David ... XSLT TRANSFORMATION FROM XML TO plain Text I have an XML FILE that is to be converted to Plain Text using an XSL file. Since I just want plain text, I do not want to set any root element during transformation.And if I do not any root element during transformation, it return s "java.lang.IllegalStateException: Root element not set" exception. If I add any element for the enclosed root, it works. Note: I am using XMLOutputter object of JDOM API, packages javax.xml.transform and javax.xml.transform.stream.* Example XML file: <root><nextpart>test</nextpart></root> *******************XSL FILE that returns exception***************************** <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="text" indent="yes"/> <xsl:template match="root"> <xsl:text>Hello This is the content.</xsl:text> <xsl:apply-templates select="nextpart"/> </xsl:template> ........... </xsl:stylesheet> ************************xsl file**************************** ***********************XSL FILE modified***************************** <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="text" indent="yes"/> <xsl:template match="root"> <document> <xs... Parsing text with link from xml with XSLT Hi, I have an xml document like this: <paragraph>hello what are you doing? searching on <link url="http:// www.google.com">google</link>?</paragraph> how can I extract data to xhtml from it so that it will be formatted as hello what are you doing? searching on <a href="http:// www.google.com">google</a>? I've tried various different methods but I can't seem to combine the text in the <paragraph> with the <link> so either I select the text: "hello what are you doing? searching on google?" or I get the link <a href="http://www.google.com">google</a> Hope someone can help, thanks in advance! Best Regards Simon, Denmark Simon Skov Boisen schrieb: > I have an xml document like this: > > <paragraph>hello what are you doing? searching on <link url="http:// > www.google.com">google</link>?</paragraph> > > how can I extract data to xhtml from it so that it will be formatted > as > > hello what are you doing? searching on <a href="http:// > www.google.com">google</a>? > > I've tried various different methods but I can't seem to combine the > text in the <paragraph> with the <link> so either I select the text: > "hello what are you doing? searching on google?" or I get the link <a > href="http://www.google.com">google</a... editor for editing xml text nodes We have xml documents which contain text imbedded as text content in some xml structures. These documents need to be translated by human translators from English into, for example, Chinese. We would like the translator to use an editor which shows him only the text content of the xml document, or gives him only editing access to the text content. The translator should be unable to touch or modify the xml tags, so that it is guaranteed that the xml-tags are unchanged when the translator returns the translated document. The translator simply replaces all English text accessible to him into Chinese text. Does anyone know an xml editing tool which has this feature, of allowing only modification to the text node content? Alois Zreindl wrote: > We have xml documents which contain text imbedded as text content in > some xml structures. > > These documents need to be translated by human translators from English > into, for example, Chinese. > > We would like the translator to use an editor which shows him only the > text content of the xml document, or gives him only editing access to > the text content. I am working on exactly this right now. It leaves the elements in element content inviolable, but allows element markup in mixed content (the only thing a translator should be touching). Please contact me by email to discuss this further. > The translator should be unable to touch or modify the xml tags, so that > it is guara... Web resources about - XSLT Extract Text from Nodes - comp.text.xml Extract, transform, load - Wikipedia, the free encyclopedia Most data warehousing projects consolidate data from different source systems. Each separate system may also use a different data organization/ ... Video to Photo Grabber - Video frame capture tool that grabs still photo and extracts high quality picture ... Get Video to Photo Grabber - Video frame capture tool that grabs still photo and extracts high quality picture from movie file on the App Store. ... Vanilla extract ready to sit - Flickr - Photo Sharing! You aren't signed in Sign In Help Home The Tour Sign Up Explore Explore Home Last 7 Days Interesting Popular Tags Calendar Most Recent Uploads ... Spare Time (1939) - extract - YouTube This classic documentary about the British at leisure arose from director Humphrey Jennings' work as one of the founders of the Mass Observation ... Pasadena Girl takes out Champagne Stakes as Peter Moody extracts every last drop ... the champion trainer wasn't expecting the filly to be a group 1 winner as a two-year-old. Just like the stubby he is always hoping to extract ... Slipper withdraws allegation over release of diary extracts Slipper withdraws allegation over release of diary extracts These Things Happen book extract by Greg Fleet - HeraldSun Search Search WARNING: Graphic content and coarse language This is an edited extract of Greg Fleet’s memoir These Things Happen, released by Macmillan Australia ... Frank Sinatra: Behind the legend book extract - J. Randy Taraborrelli IN 1938, twenty-two-year-old Frank Sinatra was young, handsome, charming, and, as a result of his bravado, able to have sex with virtually any ... Harper Lee's Go Set a Watchman: Spectrum secures exclusive Australian print extract The Sydney Morning Herald and The Age readers will be among the first in the world to read chapter one from Go Set a Watchman. Canberra extracts healthy$850m in dividends from Medibank
Canberra extracts healthy \$850m in dividends from Medibank

Resources last updated: 3/13/2016 10:30:04 PM