Your trying to read the document node instead of the root node.

Insert this code prior to the System.err.prinln()

            XdmSequenceIterator iter = doc.axisIterator(Axis.CHILD);
            doc = (XdmNode) iter.next();

Works !

doc: <wrapper content-type="application/octet-stream"/>
name: wrapper
attr: application/octet-stream


There is probably a better way but I dont see the equivilent of "GetDocumentRoot()"

David A. Lee
dlee@calldei.com  
http://www.calldei.com
http://www.xmlsh.org
812-482-5224


Norman Walsh wrote:
Hi Mike,

If I run the attached code, I get:

doc: <wrapper content-type="application/octet-stream"/>
name: null
attr: null

where name/attr are attempts to get the name and attribute value
of the element that is "doc":

System.err.println("doc: " + doc);
System.err.println("name: " + doc.getNodeName());
System.err.println("attr: " + doc.getAttributeValue(_content_type));

Clearly I'm doing something wrong, but it's not clear what. Not clear
to me, anyway.

However, I did manage to get it down to a pretty simple test case. If
you could take a look and point out where I've gone off the rails, I'd
sure appreciate it.

I'm not sure how this problem has escaped my attention for so long,
but naturally as soon as I started writing pipelines for the Balisage
symposium, everything went pear shaped. :-)

  

Be seeing you, norm

------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects

_______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ saxon-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/saxon-help