Problem with parserxml

  • Thread starter Massimiliano Candini
  • Start date
M

Massimiliano Candini

Hi everybody
first of all, sorry for my english, but i'm italian.
Ok, i have this problem, for my project i must make up a parser for SAML
String, this string is similar xml but is not xml :).
ex.
<saml:assertion id="fds" language="fhdjsl">
<saml:Attribute> attibuti da inserire OPZ </saml:Attribute>
<saml:NameIdentifier Format=\"urn:eek:asis:names:tc:SAML:1.1:nameid-format:[email protected] /">
... ....
</saml:assertion>

my problem is the parser because, saml:assertion in to xml is refer a
namespace but now is not namespace is nothing.
i have write:
XMLReader xmlReader = XMLReaderFactory.createXMLReader();
xmlReader.setFeature("http://xml.org/sax/features/namespaces",false);
SAXParserFactory spf = SAXParserFactory.newInstance();
spf.setValidating(false);
spf.setNamespaceAware(false);
SAXParser sp = spf.newSAXParser();
XMLReader r = spf.getXMLReader();
SAXReader reader = new SAXReader(r, false); // SAXReader(XMLReader xmlReader, boolean validating)
reader.setFeature("http://xml.org/sax/features/namespaces",false);
SAXParser sp = (SAXParser)spf.newSAXParser();

but not works....

the question is: how make I to say to the parser that he does not have to
validate the string it but to only see if the several one tag is opened
and close?


and as I make to take several the attributes?
i have write this:
Element root = document.getRootElement();
Attribute assertionID = root.attribute("AssertionID");


we help me????

thanks very much in advantage
Massimiliano Candini
Bologna italia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,121
Latest member
LowellMcGu
Top