[
http://nagoya.apache.org/jira/browse/XALANJ-2010?page=comments#action_56755 ]
Ramprasad Kanumuru commented on XALANJ-2010:
--------------------------------------------
Hi,
I implemented the workaround suggested by you. I have set the
ErrorListener on TransformerFactory. But I get a runtime exception:
Thanks,
Ramprasad
Caused by: java.lang.RuntimeException: Programmer's assertion in
getNextStepPos: unknown stepType: -1
at org.apache.xpath.compiler.OpMap.getNextStepPos(OpMap.java)
at
org.apache.xpath.axes.DescendantIterator.<init>(DescendantIterator.java:119)
at
org.apache.xpath.axes.WalkerFactory.newDTMIterator(WalkerFactory.java:298)
at org.apache.xpath.compiler.Compiler.locationPath(Compiler.java:670)
at org.apache.xpath.compiler.Compiler.compile(Compiler.java:210)
at org.apache.xpath.compiler.Compiler.compile(Compiler.java:156)
at org.apache.xpath.XPath.<init>(XPath.java:209)
at
org.apache.xalan.processor.StylesheetHandler.createXPath(StylesheetHandler.java:199)
at
org.apache.xalan.processor.XSLTAttributeDef.processEXPR(XSLTAttributeDef.java:796)
at
org.apache.xalan.processor.XSLTAttributeDef.processValue(XSLTAttributeDef.java:1398)
at
org.apache.xalan.processor.XSLTAttributeDef.setAttrValue(XSLTAttributeDef.java:1589)
at
org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(XSLTElementProcessor.java:381)
at
org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(XSLTElementProcessor.java:313)
at
org.apache.xalan.processor.ProcessorTemplateElem.startElement(ProcessorTemplateElem.java:122)
at
org.apache.xalan.processor.StylesheetHandler.startElement(StylesheetHandler.java:668)
at
oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1224)
at
oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:311)
at
oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:278)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:184)
at
org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:972)
> getMessageAndLocation() api of TransformerException return stack trace along
> with the error message
> ---------------------------------------------------------------------------------------------------
>
> Key: XALANJ-2010
> URL: http://nagoya.apache.org/jira/browse/XALANJ-2010
> Project: XalanJ2
> Type: Bug
> Components: JAXP
> Versions: 2.5
> Environment: Microsoft Windows 2000
> Reporter: Ramprasad Kanumuru
>
> The api getMessageAndLocation() in the class TransformerException is
> returning the stack trace of the exception along with the exception message.
> Also, the location information is missing.
> Exception message returned:
> javax.xml.transform.TransformerConfigurationException:
> javax.xml.transform.TransformerException:
> javax.xml.transform.TransformerException: Empty expression!
> ----------------------------- Sample XSL file
> --------------------------------------
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> exclude-result-prefixes="xsl xsd">
> <xsl:template match="/">
> <PO>
> <date>
> <xsl:value-of select="/invoice/date"/>
> </date>
> <supplier>
> <name>
> <xsl:value-of select="/invoice/seller/NAME"/>
> </name>
> <address>
> <street>
> <xsl:value-of select="/invoice/seller/BillAddressTo/street2"/>
> </street>
> <city>
> <xsl:value-of select="/invoice/seller/BillAddressTo/city"/>
> </city>
> <zip>
> <xsl:value-of select="/invoice/seller/BillAddressTo/pin"/>
> </zip>
> <state>
> <xsl:value-of select="/invoice/seller/BillAddressTo/state"/>
> </state>
> <streetNext>
> <xsl:value-of select="/invoice/seller/BillAddressTo/street1"/>
> </streetNext>
> </address>
> <uid>
> <xsl:value-of select="/invoice/seller/id"/>
> </uid>
> </supplier>
> <buyer>
> <name>
> <xsl:value-of select="/invoice/purchaser/NAME"/>
> </name>
> <address>
> <street>
> <xsl:value-of select="/invoice/purchaser/address/street2"/>
> </street>
> <city>
> <xsl:value-of select="/invoice/purchaser/address/city"/>
> </city>
> <xsl:if test="">
> <zip>
> <xsl:value-of select="/invoice/purchaser/address/pin"/>
> </zip>
> </xsl:if>
> <state>
> <xsl:value-of select="/invoice/purchaser/address/state"/>
> </state>
> <streetNext>
> <xsl:value-of select="/invoice/purchaser/address/street1"/>
> </streetNext>
> </address>
> <uid>
> <xsl:value-of select="/invoice/purchaser/uid"/>
> </uid>
> </buyer>
> </PO>
> </xsl:template>
> </xsl:stylesheet>
> -------------------------------End of XSL ----------------------------------
> --------------------- Instance XML -----------------------------------
> <?xml version="1.0" encoding="windows-1252"?>
> <invoice>
> <date>2004-12-08T12:24:26.630</date>
> <purchaser>
> <NAME>NAME48</NAME>
> <address>
> <street1>street149</street1>
> <street2>street250</street2>
> <city>city51</city>
> <pin>pin52</pin>
> <country>country53</country>
> <state>state54</state>
> </address>
> <uid>uid55</uid>
> </purchaser>
> <seller>
> <NAME>NAME56</NAME>
> <BillAddressTo>
> <street1>street157</street1>
> <street2>street258</street2>
> <city>city59</city>
> <pin>pin60</pin>
> <country>country61</country>
> <state>state62</state>
> </BillAddressTo>
> <id>id63</id>
> </seller>
> <line-item>
> <description>description64</description>
> <LinePrice>65</LinePrice>
> <QtyOrdered>66</QtyOrdered>
> <line-total>67</line-total>
> <id>id68</id>
> </line-item>
> <line-item>
> <description>description69</description>
> <LinePrice>70</LinePrice>
> <QtyOrdered>71</QtyOrdered>
> <line-total>72</line-total>
> <id>id73</id>
> </line-item>
> <line-item>
> <description>description74</description>
> <LinePrice>75</LinePrice>
> <QtyOrdered>76</QtyOrdered>
> <line-total>77</line-total>
> <id>id78</id>
> </line-item>
> <line-item>
> <description>description79</description>
> <LinePrice>80</LinePrice>
> <QtyOrdered>81</QtyOrdered>
> <line-total>82</line-total>
> <id>id83</id>
> </line-item>
> <line-item>
> <description>description84</description>
> <LinePrice>85</LinePrice>
> <QtyOrdered>86</QtyOrdered>
> <line-total>87</line-total>
> <id>id88</id>
> </line-item>
> <line-item>
> <description>description89</description>
> <LinePrice>90</LinePrice>
> <QtyOrdered>91</QtyOrdered>
> <line-total>92</line-total>
> <id>id93</id>
> </line-item>
> <total>94</total>
> </invoice>
> -------------------- End Instance XML
> -----------------------------------------
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]