zepheira / amara

Amara 2.0. Amara XML toolkit is an open-source collection of Python tools for XML processing, not just tools that happen to be written in Python, but tools built from the ground up to use Python idioms and take advantage of the many advantages of Python over other programming languages.
http://wiki.xml3k.org/Amara2
Apache License 2.0
23 stars 9 forks source link

Problems with common/psi.xsl of docbook xsl (docbook-xsl-1.78.1) #15

Open chimezie opened 11 years ago

chimezie commented 11 years ago

The traceback I receive (after a print statement in order to track which of the stylesheets in the import chain is currently being parsed) using a simple input document and running transform:

<?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:import href="docbook-xsl-1.78.1/fo/docbook.xsl"/> <xsl:attribute-set name="section.title.properties"> <xsl:attribute name="text-align">center/xsl:attribute </xsl:attribute-set> <xsl:attribute-set name="informaltable.properties"> <xsl:attribute name="font-size">8pt/xsl:attribute <xsl:attribute name="width">100%/xsl:attribute </xsl:attribute-set> </xsl:stylesheet>

<amara.lib._inputsource._inputsource object at 0x102bfc6e0> file:///Users/chimezieogbuji/Projects/MetacognitionLLC/HomeHealthCare/stylus-eater-metacognition/hha-portal/docbook/docbook-xsl-1.78.1/common/pi.xsl Traceback (most recent call last): [..snip..] File "/Library/Python/2.6/site-packages/amara/xslt/init.py", line 516, in transform proc.append_transform(inputsource(transforms)) File "/Library/Python/2.6/site-packages/amara/xslt/processor.py", line 210, in append_transform self.transform = self._reader.parse(source) File "/Library/Python/2.6/site-packages/amara/xslt/reader/init.py", line 861, in parse stylesheet = self._parseSrc(source, features, properties) File "/Library/Python/2.6/site-packages/amara/xslt/reader/init.py", line 885, in _parseSrc parser.parse(isrc) File "lib/src/expat/sax_handler.c", line 306, in StartElement File "/Library/Python/2.6/site-packages/amara/xslt/reader/init.py", line 456, in startElementNS self._combine_stylesheet(instance, (local == 'import')) File "/Library/Python/2.6/site-packages/amara/xslt/reader/init.py", line 687, in _combine_stylesheet self.parse(new_source) File "/Library/Python/2.6/site-packages/amara/xslt/reader/init.py", line 861, in parse stylesheet = self._parseSrc(source, features, properties) File "/Library/Python/2.6/site-packages/amara/xslt/reader/init.py", line 885, in _parseSrc parser.parse(isrc) File "lib/src/expat/sax_handler.c", line 306, in StartElement File "/Library/Python/2.6/site-packages/amara/xslt/reader/init.py", line 456, in startElementNS self._combine_stylesheet(instance, (local == 'import')) File "/Library/Python/2.6/site-packages/amara/xslt/reader/init.py", line 687, in _combine_stylesheet self.parse(new_source) File "/Library/Python/2.6/site-packages/amara/xslt/reader/init.py", line 861, in parse stylesheet = self._parseSrc(source, features, properties) File "/Library/Python/2.6/site-packages/amara/xslt/reader/init.py", line 885, in _parseSrc parser.parse(isrc) File "lib/src/expat/sax_handler.c", line 306, in StartElement File "/Library/Python/2.6/site-packages/amara/xslt/reader/init.py", line 426, in startElementNS value = attr_info.prepare(instance, value) File "/Library/Python/2.6/site-packages/amara/xslt/tree/attribute_types.py", line 485, in prepare return parse_xpattern(value) File "", line 1 error: syntax error at line 1, column 38: unexpected $undefined., expecting Literal or )

uogbuji commented 11 years ago

Hi Chimezie,

Feels like an XPattern parsing bug. Can you get a repr of the offending pattern? I guess adding a print before

/Library/Python/2.6/site-packages/amara/xslt/tree/attribute_types.py, line 485

e.g.:

print repr(value) return parse_xpattern(value)

Docbook XSL is definitely a thorough workout of the engine!

Thanks.