how to get xmlns attribute of root node in the document
Posted: Thu Jun 22, 2023 11:13 am
Hi All,
Below are two types of XML which we use with the web Author ,
Xml Type 1:
<n-load xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.application.com/product/document http://applicatiom.subnet/AppInstance/r ... cument.xsd">
.... xml content here
</n-load>
Xml type 2
<xampex xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.application.com/product/xampex http://applicatiom.subnet/XampexInstanc ... xampex.xsd">
..... xml content here
</xampex>
In our custom functionality we want to get schemalocation value from the root element. From web author UI, we have seen schema location value of the above xml stored in xmlns attribute.
We are using below code snippet to fetch xmlns attribute that we are getting null value.
authorDocumentModel..getAuthorDocumentController().getAuthorDocumentNode().getNamespace();
Can you please let us know how we can get the xmlns attribute details from the root element.
Thanks.
Below are two types of XML which we use with the web Author ,
Xml Type 1:
<n-load xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.application.com/product/document http://applicatiom.subnet/AppInstance/r ... cument.xsd">
.... xml content here
</n-load>
Xml type 2
<xampex xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.application.com/product/xampex http://applicatiom.subnet/XampexInstanc ... xampex.xsd">
..... xml content here
</xampex>
In our custom functionality we want to get schemalocation value from the root element. From web author UI, we have seen schema location value of the above xml stored in xmlns attribute.
We are using below code snippet to fetch xmlns attribute that we are getting null value.
authorDocumentModel..getAuthorDocumentController().getAuthorDocumentNode().getNamespace();
Can you please let us know how we can get the xmlns attribute details from the root element.
Thanks.