• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

getElementByTagNameNS is not working

 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I tried to pull out the signature element from a xml but the nodelist is null.



The document is

Please suggest me what went wrong .

Thanks in advance.

 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have two things to check. First, the variable XMLSignature.XMLNS should contain the correct namespace URI for the node you're looking for. That should be "http://www.w3.org/2000/09/xmldsig#".

And second, you should be creating a parser which is namespace-aware. By default the DocumentBuilderFactory produces parsers which aren't namespace-aware (a puzzling decision by the implementers but now that they documented the decision it's very hard to change) so you should be calling its setNamespaceAware() method.
reply
    Bookmark Topic Watch Topic
  • New Topic