[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [xml] xsl:copy and line breaks between attributes



Igor Zlatkovic wrote:
> > XSLT output the changes in the form of a sed script. Is it possible to
> > get at line numbers within XSLT? I'd assume xsltproc has them somewhere
> > for producing error messages?
> 
> xsltproc doesn't have them, libxml does. You could discover the line 
> number from within a C program, but XSLT offers no means known to me for 
> achieving this.

Answering my own question here, it seems that xsltproc has a way using 
one of its extensions. I looked in the libexslt source and found a
Saxon extension for a line-number() function. That does the job and I
don't mind using extensions in this case.

I suppose trying to do something in pure XSLT by counting newlines in
preceding nodes would fail for much the same reason as my original
problem: newlines between attributes in XML elements wouldn't be
counted.

Thanks

Oliver



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]