Skip to content

Commit

Permalink
Use the latest expath-parent dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
adamretter committed Jun 17, 2024
1 parent 31ef25e commit 82a8883
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.expath</groupId>
<artifactId>expath-parent</artifactId>
<version>1.6.2</version>
<version>1.7.0</version>
<relativePath />
</parent>

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/expath/tools/saxon/fun/Return.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public static Sequence dateTime(Calendar dt, boolean tz)
if ( dt == null ) {
return empty();
}
return new DateTimeValue(dt, tz);
return DateTimeValue.fromCalendar(dt, tz);
}

public static Sequence date(Date date)
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/expath/tools/saxon/fun/Types.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import net.sf.saxon.expr.StaticProperty;
import net.sf.saxon.om.NamePool;
import net.sf.saxon.om.NamespaceUri;
import net.sf.saxon.om.StructuredQName;
import net.sf.saxon.pattern.AnyNodeTest;
import net.sf.saxon.pattern.NameTest;
Expand Down Expand Up @@ -262,7 +263,7 @@ public SequenceType severalElement(String local, Processor saxon)
private SequenceType element(int occurrence, String local, Processor saxon)
{
final int kind = Type.ELEMENT;
final String uri = myLib.getNamespace();
final NamespaceUri uri = NamespaceUri.of(myLib.getNamespace());
final NamePool pool = saxon.getUnderlyingConfiguration().getNamePool();
final ItemType itype = new NameTest(kind, uri, local, pool);
return SequenceType.makeSequenceType(itype, occurrence);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
package org.expath.tools.saxon.model;

import net.sf.saxon.om.NodeInfo;
import net.sf.saxon.str.StringView;
import net.sf.saxon.trans.XPathException;
import net.sf.saxon.value.AtomicValue;
import net.sf.saxon.value.BooleanValue;
Expand Down Expand Up @@ -56,7 +57,7 @@ public boolean getBoolean()
String str = myNode.getStringValue();
AtomicValue val;
try {
val = BooleanValue.fromString(str).asAtomic();
val = BooleanValue.fromString(StringView.of(str)).asAtomic();
}
catch ( XPathException ex ) {
throw new ToolsException("Error parse the attribute value as boolean", ex);
Expand Down
13 changes: 4 additions & 9 deletions src/main/java/org/expath/tools/saxon/model/SaxonElement.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@
import java.util.Iterator;
import javax.xml.namespace.QName;
import net.sf.saxon.expr.XPathContext;
import net.sf.saxon.om.AxisInfo;
import net.sf.saxon.om.NamePool;
import net.sf.saxon.om.NamespaceResolver;
import net.sf.saxon.om.NodeInfo;
import net.sf.saxon.om.SequenceIterator;
import net.sf.saxon.om.StructuredQName;
import net.sf.saxon.om.*;
import net.sf.saxon.pattern.NameTest;
import net.sf.saxon.pattern.NamespaceTest;
import net.sf.saxon.pattern.NodeKindTest;
Expand Down Expand Up @@ -76,7 +71,7 @@ public String getAttribute(String local_name)
{
// get the attribute
NamePool pool = myNode.getConfiguration().getNamePool();
NodeTest pred = new NameTest(Type.ATTRIBUTE, "", local_name, pool);
NodeTest pred = new NameTest(Type.ATTRIBUTE, NamespaceUri.NULL, local_name, pool);
AxisIterator attrs = myNode.iterateAxis(AxisInfo.ATTRIBUTE, pred);
NodeInfo a = (NodeInfo) attrs.next();
// return its string value, or null if there is no such attribute
Expand All @@ -99,7 +94,7 @@ public Iterable<Attribute> attributes()
public boolean hasNoNsChild()
{
NamePool pool = myNode.getConfiguration().getNamePool();
NodeTest no_ns_pred = new NamespaceTest(pool, Type.ELEMENT, "");
NodeTest no_ns_pred = new NamespaceTest(pool, Type.ELEMENT, NamespaceUri.NULL);
NodeInfo next = myNode.iterateAxis(AxisInfo.CHILD, no_ns_pred).next();
return next != null;
}
Expand Down Expand Up @@ -170,7 +165,7 @@ public Iterable<Element> children()
public Iterable<Element> children(String ns)
{
NamePool pool = myNode.getConfiguration().getNamePool();
NodeTest pred = new NamespaceTest(pool, Type.ELEMENT, ns);
NodeTest pred = new NamespaceTest(pool, Type.ELEMENT, NamespaceUri.of(ns));
AxisIterator it = myNode.iterateAxis(AxisInfo.CHILD, pred);
return new ElemIterable(it);
}
Expand Down

0 comments on commit 82a8883

Please sign in to comment.