Subject: RE: [xsl] Re: Grouping by attribute From: "Michael Kay" <mike@xxxxxxxxxxxx> Date: Wed, 21 Oct 2009 13:34:57 +0100 |
>So i have to close the tags and reopen them in the new par. NO! you are not opening and closing tags, you are building a tree containing a hierarchy of nodes. The structure of your processing has to match the structure of the tree you are creating. You're not going to be able to solve this kind of problem if you have the wrong mental image of the processing model. I think I mentioned at the start of this thread that when the linebreak elements can occur at any depth of nesting, the problem can become quite hard. Conceptually, you need to treat any element that contains a linebreak, at any depth, as if it were itself a linebreak; and then you need to process each level of the hierarchy using the same logic. I'm afraid I don't have time today to work out the detail for you: it's not an easy problem. Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay > -----Original Message----- > From: Joo Lajos [mailto:joolui@xxxxxxxxxxx] > Sent: 21 October 2009 13:25 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: [xsl] Re: Grouping by attribute > > Hello! > > I have read through a couple of threads in this topic and it > is really nice but how can i close inner tags with grouping. > I use xslt 2.0 and managed create an xslt by your examples > but stuck with it. I want to close the paragraph at every > <linebreak/> tag. Here is an example: > > <par class="Bullet 6" xml:lang="hu"> > Valami szoveg > <inline style="color: #ff0000;"> > Sima inline > </inline> > szoveg > <inline style="color: #ff0000;"> > inline break elott. > <linebreak/> > inline break utan > </inline> > szoveg break elott > <linebreak/> > szoveg break utan > <inline style="color: #ff0000;"> > inline bold elott > <bold> > inline bold break elott > <linebreak/> > inline bold break utan > </bold> > inline bold utan > </inline> > Sima szoveg. > </par> > > Indenting is not too pretty but it can be seen that there > are linebreaks in <par> in <par><inline> and in > <par><inline><bold> I need to break up this into : > > <par class="Bullet 6" xml:lang="hu"> > Valami szoveg > <inline style="color: #ff0000;"> > Sima inline > </inline> > szoveg > <inline style="color: #ff0000;"> > inline break elott. > </inline> > </par> > <par class="Bullet 6" xml:lang="hu"> > <inline style="color: #ff0000;"> > inline break utan > </inline> > szoveg break elott > </par> > <par class="Bullet 6" xml:lang="hu"> > szoveg break utan > <inline style="color: #ff0000;"> > inline bold elott > <bold> > inline bold break elott > </bold> > </inline> > </par> > <par class="Bullet 6" xml:lang="hu"> > <inline style="color: #ff0000;"> > <bold> > inline bold break utan > </bold> > inline bold utan > </inline> > Sima szoveg. > </par> > > So i have to close the tags and reopen them in the new par. > It should be somehow univrsal because it can be in > <underline> and so on. And another thing that opening the new > <inline> or other tag the attributes should remain the same. > I was thinking to create a param which "remembers" the colsed > tags but could not figure out how to do it. > > Any help would be appreciated. > Sincerely, Lajos Joo > > > <br><br>______________________________________________________ > __<br><a > href="http://ad.adverticum.net/b/cl,1,69699,352104,434989/click.prm"> > Vasaroljon Raiffiesen bankkartyajaval, most milliskat nyerhet! > Riszletek a. www.raiffeisen.hu-n. > </a>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Re: Grouping by attribute, Joo Lajos | Thread | Re: [xsl] Re: Grouping by attribute, Martin Honnen |
Re: [xsl] Grouping by attribute, Jostein Austvik Jaco | Date | Re: [xsl] Filename encoding, Jesper Tverskov |
Month |