Menu

#26 CitationModel:mapHierarchy

open
5
2008-12-13
2008-12-11
No

Just a quick detail since we are using namespaces now. Rather than checking

if (hierarchy.name() == "citation")

I ended up having to do a check like this

if (hierarchy.name().toString() == "{http://chs.harvard.edu/xmlns/cts3/ti}citation")

Discussion

  • Neel Smith

    Neel Smith - 2008-12-13

    Correct NS handling in groovy: you can test class of <ELEMENT>.name(). If there is no NS support, it's a String; if there is NS support, it's a QName, which you can then manipulate with that class's methods (e.g., in your example, you could check hierarchy.name().getLocalName() == 'citation')

     
  • Neel Smith

    Neel Smith - 2008-12-13
    • assigned_to: nobody --> neel_smith
     

Log in to post a comment.

MongoDB Logo MongoDB