Skip to content

Commit

Permalink
[bugfix] Fix test for Saxon 10
Browse files Browse the repository at this point in the history
  • Loading branch information
adamretter committed Nov 29, 2024
1 parent 3af6653 commit 88d996e
Showing 1 changed file with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
/*
* Copyright (C) 2014 Evolved Binary Ltd
*
* Changes made by Evolved Binary are proprietary and are not Open Source.
*
* NOTE: Parts of this file contain code from The eXist-db Authors.
* The original license header is included below.
*
* ----------------------------------------------------------------------------
*
* eXist-db Open Source Native XML Database
* Copyright (C) 2001 The eXist-db Authors
*
Expand Down Expand Up @@ -94,33 +103,25 @@ public void checkNamespaces_saxon() throws IOException, ParserConfigurationExcep

final Element elem = doc.getDocumentElement();
final NamedNodeMap attrs = elem.getAttributes();
assertEquals(3, attrs.getLength());
assertEquals(2, attrs.getLength());

int index = 0;

final Attr attr1 = (Attr)attrs.item(index++);
assertEquals(Node.ATTRIBUTE_NODE, attr1.getNodeType());
assertEquals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, attr1.getNamespaceURI());
assertEquals(XMLConstants.XMLNS_ATTRIBUTE, attr1.getPrefix());
assertEquals(XMLConstants.XML_NS_PREFIX, attr1.getLocalName());
assertEquals(XMLConstants.XMLNS_ATTRIBUTE + ":" + XMLConstants.XML_NS_PREFIX, attr1.getNodeName());
assertEquals(XMLConstants.XML_NS_URI, attr1.getValue());
assertEquals(null, attr1.getPrefix());
assertEquals(XMLConstants.XMLNS_ATTRIBUTE, attr1.getLocalName());
assertEquals(XMLConstants.XMLNS_ATTRIBUTE, attr1.getNodeName());
assertEquals("http://exist-db.org/xquery/repo", attr1.getValue());

final Attr attr2 = (Attr)attrs.item(index++);
assertEquals(Node.ATTRIBUTE_NODE, attr2.getNodeType());
assertEquals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, attr2.getNamespaceURI());
assertEquals(null, attr2.getPrefix());
assertEquals(XMLConstants.XMLNS_ATTRIBUTE, attr2.getLocalName());
assertEquals(XMLConstants.XMLNS_ATTRIBUTE, attr2.getNodeName());
assertEquals(XMLConstants.XMLNS_ATTRIBUTE, attr2.getPrefix());
assertEquals("repo", attr2.getLocalName());
assertEquals(XMLConstants.XMLNS_ATTRIBUTE + ":repo", attr2.getNodeName());
assertEquals("http://exist-db.org/xquery/repo", attr2.getValue());

final Attr attr3 = (Attr)attrs.item(index++);
assertEquals(Node.ATTRIBUTE_NODE, attr3.getNodeType());
assertEquals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, attr3.getNamespaceURI());
assertEquals(XMLConstants.XMLNS_ATTRIBUTE, attr3.getPrefix());
assertEquals("repo", attr3.getLocalName());
assertEquals(XMLConstants.XMLNS_ATTRIBUTE + ":repo", attr3.getNodeName());
assertEquals("http://exist-db.org/xquery/repo", attr3.getValue());
}

@Test
Expand Down

0 comments on commit 88d996e

Please sign in to comment.