82 lines
3.9 KiB
Diff
82 lines
3.9 KiB
Diff
--- src/main/java/freemarker/ext/jdom/NodeListModel.java.orig 2017-10-16 02:17:50.000000000 +0100
|
|
+++ src/main/java/freemarker/ext/jdom/NodeListModel.java 2017-12-06 18:53:07.877967201 +0000
|
|
@@ -661,7 +661,7 @@
|
|
else if ("data".equals(localName))
|
|
attr = new Attribute("data", pi.getData());
|
|
else
|
|
- attr = new Attribute(localName, pi.getValue(localName));
|
|
+ attr = new Attribute(localName, pi.getPseudoAttributeValue(localName));
|
|
} else if (node instanceof DocType) {
|
|
DocType doctype = (DocType) node;
|
|
if ("publicId".equals(localName))
|
|
@@ -762,17 +762,17 @@
|
|
|
|
private static final Element getParent(Object node) {
|
|
if (node instanceof Element)
|
|
- return((Element) node).getParent();
|
|
+ return((Element) node).getParentElement();
|
|
else if (node instanceof Attribute)
|
|
return((Attribute) node).getParent();
|
|
else if (node instanceof Text)
|
|
- return((Text) node).getParent();
|
|
+ return((Text) node).getParentElement();
|
|
else if (node instanceof ProcessingInstruction)
|
|
- return((ProcessingInstruction) node).getParent();
|
|
+ return((ProcessingInstruction) node).getParentElement();
|
|
else if (node instanceof Comment)
|
|
- return((Comment) node).getParent();
|
|
+ return((Comment) node).getParentElement();
|
|
else if (node instanceof EntityRef)
|
|
- return((EntityRef) node).getParent();
|
|
+ return((EntityRef) node).getParentElement();
|
|
else
|
|
// With 2.1 semantics it makes more sense to just return a null and let the core
|
|
// throw an InvalidReferenceException and the template writer can use ?exists etcetera. (JR)
|
|
@@ -794,7 +794,7 @@
|
|
LinkedList list = new LinkedList();
|
|
do {
|
|
list.addFirst(parent);
|
|
- parent = parent.getParent();
|
|
+ parent = parent.getParentElement();
|
|
} while (parent != null);
|
|
return list;
|
|
}
|
|
@@ -808,7 +808,7 @@
|
|
list.addFirst(node);
|
|
do {
|
|
list.addFirst(parent);
|
|
- parent = parent.getParent();
|
|
+ parent = parent.getParentElement();
|
|
} while (parent != null);
|
|
return list;
|
|
}
|
|
@@ -861,7 +861,7 @@
|
|
Element parent = ((Attribute) node).getParent();
|
|
doc = parent == null ? null : parent.getDocument();
|
|
} else if (node instanceof Text) {
|
|
- Element parent = ((Text) node).getParent();
|
|
+ Element parent = ((Text) node).getParentElement();
|
|
doc = parent == null ? null : parent.getDocument();
|
|
} else if (node instanceof Document)
|
|
doc = (Document) node;
|
|
--- src/main/java/freemarker/ext/xml/_JdomNavigator.java.orig 2012-03-01 01:56:25.000000000 +0100
|
|
+++ src/main/java/freemarker/ext/xml/_JdomNavigator.java 2012-05-16 13:32:06.328559677 +0200
|
|
@@ -122,7 +122,7 @@
|
|
} else if ("data".equals(localName)) {
|
|
result.add(new Attribute("data", pi.getData()));
|
|
} else {
|
|
- result.add(new Attribute(localName, pi.getValue(localName)));
|
|
+ result.add(new Attribute(localName, pi.getPseudoAttributeValue(localName)));
|
|
}
|
|
} else if (node instanceof DocType) {
|
|
DocType doctype = (DocType) node;
|
|
@@ -186,7 +186,7 @@
|
|
Element parent = ((Attribute) node).getParent();
|
|
return parent == null ? null : parent.getDocument();
|
|
} else if (node instanceof Text) {
|
|
- Element parent = ((Text) node).getParent();
|
|
+ Element parent = ((Text) node).getParentElement();
|
|
return parent == null ? null : parent.getDocument();
|
|
} else if (node instanceof Document)
|
|
return node;
|