[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: <reductions>
From: |
Wojciech Polak |
Subject: |
Re: <reductions> |
Date: |
Wed, 10 Oct 2007 21:39:36 +0200 |
On 2007-10-09 at 23:59 -0400, Joel E. Denny wrote:
> If a user finds that the Bison-generated XML is not optimal for his
> application (perhaps because it uses SAX), he can then write XSLT (perhaps
> with the help of Bison's XSLT library) to convert it to a form that is
> perfect for his application.
I definitely love this direction. If someone wants to process
with SAX, then one should use XML to XML (extended or modified)
transformation. And it will be very easy to transform from
reduced XML to the form as in the initial version.
> I tried existing.at's test grammars and found similar slow downs.
> I added this:
>
> <xsl:key
> name="ruleKey" match="/bison-xml-report/grammar/rules/rule"
> use="@number"
> />
Great hack!
> > My patch for C and XSLT against yesterday CVS head is attached,
> > although it won't work after Joel's today commits.
> Actually, it worked for me just using the patch command.
You're right, it worked. Anyway, I'm attaching current version
against CVS head. I adjusted also xml2xhtml.xsl and put your
hack into bison.xsl (but named it ruleNumber instead of ruleKey
- this way the second part shows the "use" attribute - what do
you think?).
I would like to commit it, but the kernel attribute doesn't
work as I expect. I wrote it this way:
src/print-xml.c (print_core):
+ if (i < s->nitems) /* FIXME */
+ kernel = true;
Help me to find a better way to determine if it's a kernel
item set or not. If this is problematic, then I'll commit
this patch without the kernel attribute.
P.S. Joel, you use "required" attribute inside <xsl:param>,
but it's not part of XSLT, at least 1.0 AFAIK.
Thus, Emacs nxml-mode (highly recommended mode, btw) shows me
such XSLT as invalid. Maybe write it as XML comment?
Regards,
Wojciech
bison-cvs-20071010.diff
Description: Text Data
Re: <reductions>, Joel E. Denny, 2007/10/14
Re: <reductions>, Joel E. Denny, 2007/10/17