Just figured this one out, was reading this Cool Solution:

'Cool Solutions: Converting Strings to Nodesets'
(http://www.novell.com/coolsolutions/tip/15175.html)

And have converted it into ECMAScript:

function Parse(InString)
{
var nodeSet = new Packages.com.novell.xml.xpath.NodeSet();
var factory =
Packages.com.novell.xml.parser.XMLParserFactory.ne wParser();
var stringreader = Packages.java.io.StringReader;
var strinput = new stringreader(InString);
var doc = factory.parse(strinput);
nodeSet.add(doc);
return nodeSet;
}

Using this example:
http://forums.novell.com/novell-prod...ml#post1908085

Which does this:

// Initialize DOM API
var factory = Packages.javax.xml.parsers.DocumentBuilderFactory.
newInstance();
var builder = factory.newDocumentBuilder();
var stringreader = Packages.java.io.StringReader;
var strinput = new stringreader(softtable);
var inputsource = new Packages.org.xml.sax.InputSource(strinput);
var doc = builder.parse(inputsource);

Causes me to get an exception in Designer Simulate of
"java.lang.ClassCastException: com.novell.xml.xpath.XPathAttributeNode
cannot be cast to org.w3c.dom.Attr"

What I was trying to do, was Convert a XML string I had in ECMAScript
to a NodeSet that I could return back to Policy Builder and then do
stuff with it in Policy Builder.

Using Packages.com.novell.xml.parser.XMLParserFactory.ne wParser() works
fine

Hope other people find this helpful.


--
peter_lambrechtsen
------------------------------------------------------------------------
peter_lambrechtsen's Profile: http://forums.novell.com/member.php?userid=56168
View this thread: http://forums.novell.com/showthread.php?t=429352