<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<blockquote type="cite">
<div class="gmail_extra"><br>
<div class="gmail_quote"><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span
class="">
><br>
> static XMLObject
unmarshallFromInputStream(net.shibboleth.utilities.java.support.xml.ParserPool,
InputStream)<br>
><br>
> But I'm not sure whether this is the right method</span><br>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
Assuming that's from XMLObjectSupport, either that one or the other
one that takes a Reader (XMLObjectSupport. unmarshallFromReader( ...
)), as you already found below, are going to be the simplest way.<br>
<br>
Essentially the steps are: 1) parse the input source to a DOM
Document 2) unmarshall the Document's root element
(Document#getDocumentElement()) into an XMLObject.<br>
<br>
That basic process never really changes. Those 2 XMLObjectSupport
methods are just helpful utility methods that hide the details of
all that, handle error conditions, etc.<br>
<br>
<br>
<br>
<div class="moz-cite-prefix">On 10/5/15 12:59 PM, Camel Guy wrote:<br>
</div>
<blockquote
cite="mid:CAJtt6BiumhC_E3zJJNbP696+g6FHfAPE0Dixehz76k4qKShL-A@mail.gmail.com"
type="cite">
<div dir="ltr">
<p class="">XMLObjectSupport. unmarshallFromReader( ... )</p>
<p class="">Passing a BasicParserPool and a StringReader
wrapping a string that contains XML, I get:</p>
<p class="">2015-10-05 09:50:29,884 - ERROR
[org.opensaml.core.xml.util.XMLObjectSupport:213] - Unable to
unmarshall Reader, no unmarshaller registered for element
attributes</p>
</div>
</blockquote>
<br>
Yeah, I don't know what the error is based on that. The line number
and log text there don't match up with the latest trunk. Exactly
what version of the IdP are you running here?<br>
<br>
<br>
<blockquote
cite="mid:CAJtt6BiumhC_E3zJJNbP696+g6FHfAPE0Dixehz76k4qKShL-A@mail.gmail.com"
type="cite">
<div dir="ltr">
<p class="">I need to parse XML, not unmarshal binary goo, so
XMLObjectSupport appears to be a dead end.</p>
</div>
</blockquote>
<br>
It's not, it's exactly what you need. At least the simplest way.<br>
<br>
You need to clarify what your "XML" is. In general that's not a
meaningful description. You probably mean a String serialization of
an XML structure, and so a Reader or InputStream is exactly what you
need there. It's not binary goo. If you were doing this with plain
old Java and JAXP, you'd still need to parse that "XML" into a DOM
Document. It's no different here.<br>
<br>
Would also be helpful to know where/how you're getting this XML
(reading from a file? building yourself on-the-fly?). And what it
actually looks like (the content). If it's not a type supported by
the existing XMLObject providers registered in the system for known
schemas, then you'll need to understand how to work with the
structure you get back - probably an XSAny instance, which is sort
of a generic type able to represent any content model.<br>
<br>
Re: reading/parsing an some XML serialization: if you are currently
building this on the fly, it might be simpler to actually just build
the XMLObject in your code, as opposed to trying to parse something
unnecessarily, like building up a String and then parsing it
(although the latter is perfectly possibly, just inefficient - both
performance-wise and developer-wise).<br>
<br>
--Brent<br>
<br>
<br>
</body>
</html>