Package javax.xml.stream

Examples of javax.xml.stream.XMLStreamWriter.writeAttribute()


               writer.writeStartDocument(Constants.DEFAULT_ENCODING, "1.0");
               writer.writeStartElement(XML_NODE);
               writer.writeAttribute(PREFIX_XMLNS, PREFIX_LINK);
               writer.writeAttribute(XLINK_XMLNS, XLINK_LINK);
               writer.writeAttribute(XML_NAME, node.getName());
               writer.writeAttribute(XML_HREF, rootHref + TextUtil.escape(node.getPath(), '%', true));


               if (!node.getPath().equals("/"))
               {
                  // this is added to fix EXOJCR-1379
View Full Code Here


                  // XSLT string operations with actual node href, (which are used during XSLT transformation
                  // to receive parent href) produce wrong parent-href if node path containes non-latin symbols,
                  // so instead we simply add one more attribute which already contains parent-href
                  // as result: no XLST processor string manipulation is needed
                  String nodeParentHref = rootHref + TextUtil.escape(node.getParent().getPath(), '%', true);
                  writer.writeAttribute(XML_PARENT_HREF, nodeParentHref);
               }


               // add properties
               for (PropertyIterator pi = node.getProperties(); pi.hasNext();)
View Full Code Here

               // add properties
               for (PropertyIterator pi = node.getProperties(); pi.hasNext();)
               {
                  Property curProperty = pi.nextProperty();
                  writer.writeStartElement(XML_PROPERTY);
                  writer.writeAttribute(XML_NAME, curProperty.getName());
                  String propertyHref = rootHref + curProperty.getPath();
                  writer.writeAttribute(XML_HREF, propertyHref);
                  writer.writeEndElement();
               }
               // add subnodes
View Full Code Here

               {
                  Property curProperty = pi.nextProperty();
                  writer.writeStartElement(XML_PROPERTY);
                  writer.writeAttribute(XML_NAME, curProperty.getName());
                  String propertyHref = rootHref + curProperty.getPath();
                  writer.writeAttribute(XML_HREF, propertyHref);
                  writer.writeEndElement();
               }
               // add subnodes
               for (NodeIterator ni = node.getNodes(); ni.hasNext();)
               {
View Full Code Here

               // add subnodes
               for (NodeIterator ni = node.getNodes(); ni.hasNext();)
               {
                  Node childNode = ni.nextNode();
                  writer.writeStartElement(XML_NODE);
                  writer.writeAttribute(XML_NAME, childNode.getName());
                  String childNodeHref = rootHref + TextUtil.escape(childNode.getPath(), '%', true);
                  writer.writeAttribute(XML_HREF, childNodeHref);
                  writer.writeEndElement();
               }
               writer.writeEndElement();
View Full Code Here

               {
                  Node childNode = ni.nextNode();
                  writer.writeStartElement(XML_NODE);
                  writer.writeAttribute(XML_NAME, childNode.getName());
                  String childNodeHref = rootHref + TextUtil.escape(childNode.getPath(), '%', true);
                  writer.writeAttribute(XML_HREF, childNodeHref);
                  writer.writeEndElement();
               }
               writer.writeEndElement();
               writer.writeEndDocument();
            }
View Full Code Here

               XMLOutputFactory factory = XMLOutputFactory.newInstance();
               XMLStreamWriter writer = factory.createXMLStreamWriter(po, Constants.DEFAULT_ENCODING);

               writer.writeStartDocument(Constants.DEFAULT_ENCODING, "1.0");
               writer.writeStartElement(XML_NODE);
               writer.writeAttribute(PREFIX_XMLNS, PREFIX_LINK);
               writer.writeAttribute(XLINK_XMLNS, XLINK_LINK);
               writer.writeAttribute(XML_NAME, node.getName());
               writer.writeAttribute(XML_HREF, rootHref + TextUtil.escape(node.getPath(), '%', true));
               // add properties
               for (PropertyIterator pi = node.getProperties(); pi.hasNext();)
View Full Code Here

               XMLStreamWriter writer = factory.createXMLStreamWriter(po, Constants.DEFAULT_ENCODING);

               writer.writeStartDocument(Constants.DEFAULT_ENCODING, "1.0");
               writer.writeStartElement(XML_NODE);
               writer.writeAttribute(PREFIX_XMLNS, PREFIX_LINK);
               writer.writeAttribute(XLINK_XMLNS, XLINK_LINK);
               writer.writeAttribute(XML_NAME, node.getName());
               writer.writeAttribute(XML_HREF, rootHref + TextUtil.escape(node.getPath(), '%', true));
               // add properties
               for (PropertyIterator pi = node.getProperties(); pi.hasNext();)
               {
View Full Code Here

               writer.writeStartDocument(Constants.DEFAULT_ENCODING, "1.0");
               writer.writeStartElement(XML_NODE);
               writer.writeAttribute(PREFIX_XMLNS, PREFIX_LINK);
               writer.writeAttribute(XLINK_XMLNS, XLINK_LINK);
               writer.writeAttribute(XML_NAME, node.getName());
               writer.writeAttribute(XML_HREF, rootHref + TextUtil.escape(node.getPath(), '%', true));
               // add properties
               for (PropertyIterator pi = node.getProperties(); pi.hasNext();)
               {
                  Property curProperty = pi.nextProperty();
View Full Code Here

               writer.writeStartDocument(Constants.DEFAULT_ENCODING, "1.0");
               writer.writeStartElement(XML_NODE);
               writer.writeAttribute(PREFIX_XMLNS, PREFIX_LINK);
               writer.writeAttribute(XLINK_XMLNS, XLINK_LINK);
               writer.writeAttribute(XML_NAME, node.getName());
               writer.writeAttribute(XML_HREF, rootHref + TextUtil.escape(node.getPath(), '%', true));
               // add properties
               for (PropertyIterator pi = node.getProperties(); pi.hasNext();)
               {
                  Property curProperty = pi.nextProperty();
                  writer.writeStartElement(XML_PROPERTY);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.