/** * Exports the given node either as XML characters (if it's an * <code>xml:text</code> node) or as an XML element with properties * mapped to XML attributes. */ protected void exportNode(String uri, String local, Node node) throws RepositoryException, SAXException { if (NamespaceHelper.JCR.equals(uri) && "xmltext".equals(local)) { try { // assume jcr:xmlcharacters is single-valued Property property = node.getProperty(helper.getJcrName("jcr:xmlcharacters")); char[] ch = property.getString().toCharArray(); characters(ch, 0, ch.length); } catch (PathNotFoundException e) { // jcr:xmlcharacters not found, ignore this node } } else { // attributes (properties) exportProperties(node); // encode node name to make sure it's a valid xml name String encoded = ISO9075.encode(local); startElement(uri, encoded); exportNodes(node); endElement(uri, encoded); } }
/** * Exports the given node either as XML characters (if it's an * <code>xml:text</code> node) or as an XML element with properties * mapped to XML attributes. */ protected void exportNode(String uri, String local, Node node) throws RepositoryException, SAXException { if (NamespaceHelper.JCR.equals(uri) && "xmltext".equals(local)) { try { // assume jcr:xmlcharacters is single-valued Property property = node.getProperty(helper.getJcrName("jcr:xmlcharacters")); char[] ch = property.getString().toCharArray(); characters(ch, 0, ch.length); } catch (PathNotFoundException e) { // jcr:xmlcharacters not found, ignore this node } } else { // attributes (properties) exportProperties(node); // encode node name to make sure it's a valid xml name String encoded = ISO9075.encode(local); startElement(uri, encoded); exportNodes(node); endElement(uri, encoded); } }
/** * Exports the given node either as XML characters (if it's an * <code>xml:text</code> node) or as an XML element with properties * mapped to XML attributes. */ protected void exportNode(String uri, String local, Node node) throws RepositoryException, SAXException { if (NamespaceHelper.JCR.equals(uri) && "xmltext".equals(local)) { try { // assume jcr:xmlcharacters is single-valued Property property = node.getProperty(helper.getJcrName("jcr:xmlcharacters")); char[] ch = property.getString().toCharArray(); characters(ch, 0, ch.length); } catch (PathNotFoundException e) { // jcr:xmlcharacters not found, ignore this node } } else { // attributes (properties) exportProperties(node); // encode node name to make sure it's a valid xml name String encoded = ISO9075.encode(local); startElement(uri, encoded); exportNodes(node); endElement(uri, encoded); } }