Compare commits
6 Commits
master
...
ee21a15600
| Author | SHA1 | Date | |
|---|---|---|---|
| ee21a15600 | |||
| 3b4eeacb93 | |||
| a872350c9d | |||
| f618b882e8 | |||
| 2c8470b4e2 | |||
| 8d6d97c555 |
@@ -79,13 +79,11 @@ def xpath(source: str, xpath: str) -> str:
|
|||||||
else:
|
else:
|
||||||
result_string = ""
|
result_string = ""
|
||||||
for e in result:
|
for e in result:
|
||||||
if isinstance(e, etree._Element):
|
|
||||||
result_string += etree.tostring(e, pretty_print=True).decode() + "\n"
|
result_string += etree.tostring(e, pretty_print=True).decode() + "\n"
|
||||||
else:
|
|
||||||
result_string += str(e) + "\n"
|
|
||||||
return result_string, "node"
|
return result_string, "node"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def xsd(source: str, xsd: str) -> bool:
|
def xsd(source: str, xsd: str) -> bool:
|
||||||
"""
|
"""
|
||||||
Method used to validate XML string against XSD schema
|
Method used to validate XML string against XSD schema
|
||||||
|
|||||||
@@ -61,13 +61,6 @@ public class Xalan implements XmlEngine{
|
|||||||
return nodeType == Node.CDATA_SECTION_NODE || nodeType == Node.TEXT_NODE;
|
return nodeType == Node.CDATA_SECTION_NODE || nodeType == Node.TEXT_NODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isAttributeNode(Node n) {
|
|
||||||
if (n == null)
|
|
||||||
return false;
|
|
||||||
short nodeType = n.getNodeType();
|
|
||||||
return nodeType == Node.CDATA_SECTION_NODE || nodeType == Node.ATTRIBUTE_NODE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String processXSLT(XMLMultipleFilesData[] data, String transform) throws Exception {
|
public String processXSLT(XMLMultipleFilesData[] data, String transform) throws Exception {
|
||||||
throw new UnsupportedOperationException("Xalan does not support multiple files XSLT processing");
|
throw new UnsupportedOperationException("Xalan does not support multiple files XSLT processing");
|
||||||
@@ -108,10 +101,7 @@ public class Xalan implements XmlEngine{
|
|||||||
for (Node nn = n.getNextSibling(); isTextNode(nn); nn = nn.getNextSibling()) {
|
for (Node nn = n.getNextSibling(); isTextNode(nn); nn = nn.getNextSibling()) {
|
||||||
resultString.append(nn.getNodeValue());
|
resultString.append(nn.getNodeValue());
|
||||||
}
|
}
|
||||||
} else if (isAttributeNode(n)) {
|
} else {
|
||||||
resultString.append(n.getNodeValue());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||||
serializer.transform(new DOMSource(n), new StreamResult(new OutputStreamWriter(outputStream)));
|
serializer.transform(new DOMSource(n), new StreamResult(new OutputStreamWriter(outputStream)));
|
||||||
resultString.append(outputStream);
|
resultString.append(outputStream);
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
"@components/*":["./src/components/*"],
|
"@components/*":["./src/components/*"],
|
||||||
"@views/*":["./src/views/*"],
|
"@views/*":["./src/views/*"],
|
||||||
"@assets/*":["./src/assets/*"],
|
"@assets/*":["./src/assets/*"],
|
||||||
}
|
},
|
||||||
|
"types": ["vite/client", "vue"]
|
||||||
},
|
},
|
||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user