I need to use the transform package (transformer, transformfactory,
etc.) so that I can convert an xml node to a new document. However,
when I try to import the package, it says that it cannot be resolved.
Are you not allowed to use this package on Android?

Below is the code subset of how I want to transform:

import javax.xml.transform.Transformer;
import javax.xml.transform.*;
import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.dom.DOMSource;

Node adherenceIntervals = reportXML.getFirstChild().getFirstChild();
TransformerFactory tf = TransformerFactory.newInstance();
Transformer xf = tf.newTransformer();
DOMResult dr = new DOMResult();
xf.transform(new DOMSource(adherenceIntervals), dr);
Document adherenceIntervalsDoc = (Document) dr.getNode();

NodeList medicationNodes = adherenceIntervalsDoc.getElementsByTagName
("Medication");
int medicationLength = medicationNodes.getLength();

Any thoughts?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to