[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Parsing complex line (mixed text and markup)

Subject: Parsing complex line (mixed text and markup)
From: "Ilya Lifshits" <chehlo@xxxxxxxxx>
Date: Tue, 19 Feb 2008 22:50:43 +0200
 Parsing complex line (mixed text and markup)
Hello,

I have a problem to handle entities using advised solution :

The modified xsl template can be found here : http://pastebin.com/f1034d9b0
(I don't know what is the list policy about long examples so i posted
it on the web. They state that post will be saved forever, so it will
be good for future use as well).

<tblrow>&j_cdc_spec_ref;,,&j_cdc_spec_name;,,&j_url;</tblrow>

j_cdc_spec_ref and j_cdc_spec_name is a simple text replacement and
handled correctly. But the last one :

j_url is : <!ENTITY j_url          "<ulink url=http://www.jungo.com/>">

and just does not produce any output, i.e 2 entries created instead of 3.

So 2 questions:

First  question.
 My decision was to handle every piece of reusable code in 2 ways :
1) Entities for static reusable code (#defines)
2) Named parameter templates for dynamic reusable code  (functions)

As i come from C language background and thinking "C" I'm not sure
that i doing the right thing at all.
 The question is: What is the correct approach for code/definition
reuse in xsl ?

Just a side note the solution must be very simple and short in the xml
part and can be complex and long at the xsl side. (xsl is a one time
work, xml syntax will be massively used).

Second question:
How to handle correctly the entities in my case ?  Even in case i use
the wrong approach i would like to understand what is the solution for
the problem.

Thanks for any suggestion,
Ilya.




On Feb 15, 2008 1:56 AM, Ilya Lifshits <chehlo@xxxxxxxxx> wrote:

> Working exactly as i expected.
> Thanks for the fix i was trying to find a way how to remove it before
> i ask :) Like i sad I'm completely newbie.
>
> Comma probably not a best delimiter, i will replace it with some
> sequence, but the main idea is clear and working.
> Regards Ilya.
>
>
>
>
> On Fri, Feb 15, 2008 at 1:48 AM, Michael Kay <mike@xxxxxxxxxxxx> wrote:
> > > Then (at [G] above) process the new tbentry using grouping
> >  >
> >  >   <xsl:for-each-group select="$temp/child::node()"
> >  > group-starting-with="comma">
> >  >     <entry><xsl:copy-of select="current-group()"/></entry>
> >  >   <xsl:for-each-group>
> >  >
> >  > Not tested!
> >
> >  One bug I spotted on re-reading: it doesn't remove the <comma/> elements.
> >  Change the copy-of to:
> >
> >  <entry><xsl:copy-of select="current-group()[not(self::comma)]"/></entry>
> >
> > >
> >  > Michael Kay
> >  > http://www.saxonica.com/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.