Hi,
 
i found a solution. It is a problem with the XmlHolder and not with Saxon, i think. I don´t know exactly why but i have to do it like this:
 
holder.removeDomNodes("//*[text()='-']")
holder = groovyUtils.getXmlHolder( holder.prettyXml )
holder.removeDomNodes("//*[text()='--']/..")
 
Thanks Christopher


Von: Michael Kay [mailto:mike@saxonica.com]
Gesendet: Freitag, 5. August 2011 14:52
An: saxon-help@lists.sourceforge.net; Steinmann, Christopher
Betreff: Re: [saxon] NullPointer at getDomNodes

As a workaround, since it's failed in the complex code for handling non-normalized DOM text nodes, try to avoid using text() (it's probably not what you should be using anyway.) Try

holder.getDomNodes("//*[.='--']/..")

or perhaps even

holder.getDomNodes("//*[*='--']")

Michael Kay
Saxonica

On 04/08/2011 12:50, Steinmann, Christopher wrote:

Hi,

i get a NullPointerException when i try the following: holder.getDomNodes("//*[text()='--']/..")

and here the StackTrace:

Thu Aug 04 13:37:39 CEST 2011:ERROR:java.lang.NullPointerException
   java.lang.NullPointerException
        at net.sf.saxon.dom.NodeWrapper$ChildEnumeration.skipFollowingTextNodes(NodeWrapper.java:1142)
        at net.sf.saxon.dom.NodeWrapper$ChildEnumeration.next(NodeWrapper.java:1169)
        at net.sf.saxon.om.Navigator$DescendantEnumeration.advance(Navigator.java:1013)
        at net.sf.saxon.om.Navigator$DescendantEnumeration.advance(Navigator.java:1072)
        at net.sf.saxon.om.Navigator$BaseEnumeration.next(Navigator.java:915)
        at net.sf.saxon.om.Navigator$DescendantEnumeration.advance(Navigator.java:1004)
        at net.sf.saxon.om.Navigator$BaseEnumeration.next(Navigator.java:915)
        at net.sf.saxon.om.Navigator$DescendantEnumeration.advance(Navigator.java:1004)
        at net.sf.saxon.om.Navigator$BaseEnumeration.next(Navigator.java:915)
        at net.sf.saxon.om.Navigator$DescendantEnumeration.advance(Navigator.java:1004)
        at net.sf.saxon.om.Navigator$BaseEnumeration.next(Navigator.java:915)
        at net.sf.saxon.om.Navigator$DescendantEnumeration.advance(Navigator.java:1004)
        at net.sf.saxon.om.Navigator$BaseEnumeration.next(Navigator.java:915)
        at net.sf.saxon.om.Navigator$DescendantEnumeration.advance(Navigator.java:1004)
        at net.sf.saxon.om.Navigator$BaseEnumeration.next(Navigator.java:915)
        at net.sf.saxon.om.Navigator$DescendantEnumeration.advance(Navigator.java:1004)
        at net.sf.saxon.om.Navigator$BaseEnumeration.next(Navigator.java:915)
        at net.sf.saxon.om.Navigator$DescendantEnumeration.advance(Navigator.java:1004)
        at net.sf.saxon.om.Navigator$BaseEnumeration.next(Navigator.java:915)
        at net.sf.saxon.om.Navigator$AxisFilter.next(Navigator.java:885)
        at net.sf.saxon.expr.ContextMappingIterator.next(ContextMappingIterator.java:44)
        at net.sf.saxon.expr.FilterIterator.getNextMatchingItem(FilterIterator.java:61)
        at net.sf.saxon.expr.FilterIterator.next(FilterIterator.java:44)
        at net.sf.saxon.expr.ContextMappingIterator.next(ContextMappingIterator.java:51)
        at net.sf.saxon.value.SequenceExtent.<init>(SequenceExtent.java:98)
        at net.sf.saxon.sort.DocumentOrderIterator.<init>(DocumentOrderIterator.java:30)
        at net.sf.saxon.sort.DocumentSorter.iterate(DocumentSorter.java:85)
        at net.sf.saxon.sxpath.XPathExpression.evaluate(XPathExpression.java:98)
        at org.apache.xmlbeans.impl.xpath.saxon.XBeansXPath.selectNodes(XBeansXPath.java:119)
        at org.apache.xmlbeans.impl.xpath.saxon.XBeansXPath.selectPath(XBeansXPath.java:148)
        at org.apache.xmlbeans.impl.store.Path$DelegatePathImpl$DelegatePathEngine.next(Path.java:541)
        at org.apache.xmlbeans.impl.store.Cursor._toSelection(Cursor.java:931)
        at org.apache.xmlbeans.impl.store.Cursor._toNextSelection(Cursor.java:920)
        at org.apache.xmlbeans.impl.store.Cursor.toNextSelection(Cursor.java:2670)
        at com.eviware.soapui.support.xml.XmlUtils.selectFirstDomNode(XmlUtils.java:1227)
        at com.eviware.soapui.support.XmlHolder.getDomNode(XmlHolder.java:145)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:229)

        at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
        at Script2.run(Script2.groovy:45)
        at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:96)
        at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SourceFile:88)

        at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:148)
        at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:274)

        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)

I need Help, pls.

========================================================================= AXA Konzern Aktiengesellschaft Sitz der Gesellschaft Köln Handelsregister Köln HR B Nr. 672 Vorsitzender des Aufsichtsrats: Jacques de Vaucleroy Vorstand: Dr. Frank W. Keuper, Vorsitzender Dr. Patrick Dahmen, Wolfgang Hanssmann, Thomas Gerber, Dr. Markus Hofmann, Ulrich C. Nießen, Dr. Heinz-Jürgen Schwering, Jens Wieland ------------------------------------------------------------------------- Der Inhalt dieser E-Mail ist vertraulich und ausschliesslich fuer den bezeichneten Adressaten oder dessen Vertreter bestimmt. Sollten Sie nicht der vorgesehene Adressat dieser E-Mail oder dessen Vertreter sein, so bitten wir Sie, sich mit dem Absender der E-Mail in Verbindung zu setzen. Beachten Sie bitte, dass jede Form der unautorisierten Nutzung, Veroeffentlichung, Vervielfaeltigung oder Weitergabe des Inhaltes dieser E-Mail nicht gestattet ist. ------------------------------------------------------------------------- This message contains confidential information and is exclusively for the person addressed or their representative. If you are not the intended recipient of this message and its contents, please notify the sender immediately. Any form of unauthorised use, publication, reproduction, copying or disclosure of the content of the e-mail is not permitted. =========================================================================
------------------------------------------------------------------------------ BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA The must-attend event for mobile developers. Connect with experts. Get tools for creating Super Apps. See the latest technologies. Sessions, hands-on labs, demos & much more. Register early & save! http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ saxon-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/saxon-help

=========================================================================
AXA Konzern Aktiengesellschaft
Sitz der Gesellschaft Köln
Handelsregister Köln HR B Nr. 672
Vorsitzender des Aufsichtsrats: Jacques de Vaucleroy
Vorstand: Dr. Frank W. Keuper, Vorsitzender
Dr. Patrick Dahmen, Wolfgang Hanssmann, Thomas Gerber,
Dr. Markus Hofmann, Ulrich C. Nießen,
Dr. Heinz-Jürgen Schwering, Jens Wieland
-------------------------------------------------------------------------
Der Inhalt dieser E-Mail ist vertraulich und ausschliesslich fuer den
bezeichneten Adressaten oder dessen Vertreter bestimmt. Sollten Sie
nicht der vorgesehene Adressat dieser E-Mail oder dessen Vertreter sein,
so bitten wir Sie, sich mit dem Absender der E-Mail in Verbindung zu
setzen. Beachten Sie bitte, dass jede Form der unautorisierten Nutzung,
Veroeffentlichung, Vervielfaeltigung oder Weitergabe des Inhaltes dieser
E-Mail nicht gestattet ist.
-------------------------------------------------------------------------
This message contains confidential information and is exclusively for the
person addressed or their representative. If you are not the intended
recipient of this message and its contents, please notify the sender
immediately. Any form of unauthorised use, publication, reproduction,
copying or disclosure of the content of the e-mail is not permitted.
=========================================================================