Comments (3)
Please provide a test case. I am unable to reproduce ;-) could your xpath or paramk be wrong ?
XMLTag doc = XMLDoc.newDocument(false).addRoot("html")
.addTag("body").addText("txt")
.addTag("head").addText("txt1")
.addTag("head").addText("txt2");
assertEquals(doc.gotoRoot().gotoTag("head[%s]", "1").getText(), "txt1");
from xmltool.
XMLTag doc = XMLDoc.newDocument(false).addRoot("html")
.addTag("body").addText("txt")
.addTag("head").addText("txt1")
.addTag("head").addText("txt2");
assertEquals(doc.gotoRoot().gotoTag("head123[%s]", "1").getText(), "txt1");
from xmltool.
Oh sorry! When "target node is not found" ;-)
It is a minor bug actually the Exception is not well built because of the String.format. You should get the error:
com.mycila.xmltool.XMLDocumentException: Error executing xpath 'head123[1]' from node 'html': Inexisting target node.
from xmltool.
Related Issues (19)
- Insert before HOT 1
- Website: include Maven reports
- Support to set encoding of source
- XMLDocBuilder.newDocumentBuilder is a performance issue HOT 1
- Compile with JDK 1.6
- XMLTag creation is not thread safe HOT 6
- Comments ordering HOT 1
- Provide way to obtain org.w3c.dom.Attr
- Update README, doc & website
- XMLDoc.from(...) should return XMLDoc
- DefaultNameSpace is not showing
- Provide a virtual node structure for unavailable nodes.
- document.normalize in multi-thread env has performance problem
- Doctype support HOT 1
- Support encoding (Handling the "Content not allowed in prolog" message) HOT 2
- Use pom 2
- MIgration from Google Code
- Documentation review
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xmltool.