KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am trying to fetch the below xml from db using a java method but I am getting an error Code used to parse the xml DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); InputSource is = new InputSource(new ByteArrayInputStream(cond.getBytes())); Document doc = db.parse(is); Element elem = doc.getDocumentElement(); // here we expect a series of <data><name>N</name><value>V</value></data> NodeList nodes = elem.getElementsByTagName("data"); TableID jobId = new TableID(_processInstanceId); Job myJob = Job.queryByID(_clientContext, jobId, true); if (nodes.getLength() == 0) { log(Level.DEBUG, "No data found on condition XML"); } for (int i = 0; i < nodes.getLength(); i++) { // loop through the <data> in the XML Element dataTags = (Element) nodes.item(i); String name = getChildTagValue(dataTags, "name"); String value = getChildTagValue(dataTags, "value"); log(Level.INFO, "UserData/Value=" + name + "/" + value); myJob.setBulkUserData(name, value); } myJob.save(); The Data <ContactDetails>307896043</ContactDetails> <ContactName>307896043</ContactName> <Preferred_Completion_Date> </Preferred_Completion_Date> <service_address>A-End Address: 1ST HELIERST HELIERJT2 3XP832THE CABLES 1 POONHA LANEST HELIER JE JT2 3XP</service_address> <ServiceOrderId>315473043</ServiceOrderId> <ServiceOrderTypeId>50</ServiceOrderTypeId> <CustDesiredDate>2013-03-20T18:12:04</CustDesiredDate> <OrderId>307896043</OrderId> <CreateWho>csmuser</CreateWho> <AccountInternalId>20100333</AccountInternalId> <ServiceInternalId>20766093</ServiceInternalId> <ServiceInternalIdResets>0</ServiceInternalIdResets> <Primary_Offer_Name action='del'>MyMobile Blue &
Tags (comma-separated)
Save Edits
Cancel