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=\"urnasis: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
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=\"urnasis: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