ProcessingInstruction pi = (ProcessingInstruction) node; if ("target".equals(localName)) attr = new Attribute("target", pi.getTarget()); else if ("data".equals(localName)) attr = new Attribute("data", pi.getData()); else attr = new Attribute(localName, pi.getValue(localName)); } else if (node instanceof DocType) { DocType doctype = (DocType) node; if ("publicId".equals(localName)) attr = new Attribute("publicId", doctype.getPublicID()); else if ("systemId".equals(localName)) attr = new Attribute("systemId", doctype.getSystemID()); else if ("elementName".equals(localName)) attr = new Attribute("elementName", doctype.getElementName());
ProcessingInstruction pi = (ProcessingInstruction) node; if ("target".equals(localName)) { result.add(new Attribute("target", pi.getTarget())); } else if ("data".equals(localName)) { result.add(new Attribute("data", pi.getData())); } else { result.add(new Attribute(localName, pi.getValue(localName))); result.add(new Attribute("publicId", doctype.getPublicID())); } else if ("systemId".equals(localName)) { result.add(new Attribute("systemId", doctype.getSystemID())); } else if ("elementName".equals(localName)) { result.add(new Attribute("elementName", doctype.getElementName()));
public Attribute attribute(String name, String value, int type) { Attribute a = new Attribute(); a.name = name; a.type = type; a.value = value; a.namespace = Namespace.NO_NAMESPACE; return a; }
public void writeAttribute(String local, String value) throws XMLStreamException { currentNode.setAttribute(new Attribute(local, value)); }
public void writeAttribute(String prefix, String namespace, String local, String value) throws XMLStreamException { currentNode.setAttribute(new Attribute(local, value, Namespace.getNamespace(prefix, namespace))); }
public void writeAttribute(String prefix, String namespace, String local, String value) throws XMLStreamException { currentNode.setAttribute(new Attribute(local, value, Namespace.getNamespace(prefix, namespace))); }
public void writeAttribute(String namespace, String local, String value) throws XMLStreamException { currentNode.setAttribute(new Attribute(local, value, Namespace.getNamespace(namespace))); }
protected Element generateSourceElement(Source source) { Element sourceElement = new Element("source",getFeedNamespace()); if (source.getUrl() != null) { sourceElement.setAttribute(new Attribute("url", source.getUrl())); } sourceElement.addContent(source.getValue()); return sourceElement; }
protected Element generateSourceElement(Source source) { Element sourceElement = new Element("source",getFeedNamespace()); if (source.getUrl() != null) { sourceElement.setAttribute(new Attribute("url", source.getUrl())); } sourceElement.addContent(source.getValue()); return sourceElement; }
protected Element generateTagLineElement(Content tagline) { Element taglineElement = new Element("subtitle", getFeedNamespace()); if (tagline.getType() != null) { Attribute typeAttribute = new Attribute("type", tagline.getType()); taglineElement.setAttribute(typeAttribute); } if (tagline.getValue() != null) { taglineElement.addContent(tagline.getValue()); } return taglineElement; }
protected Element generateTagLineElement(Content tagline) { Element taglineElement = new Element("subtitle", getFeedNamespace()); if (tagline.getType() != null) { Attribute typeAttribute = new Attribute("type", tagline.getType()); taglineElement.setAttribute(typeAttribute); } if (tagline.getValue() != null) { taglineElement.addContent(tagline.getValue()); } return taglineElement; }
protected Element generateTagLineElement(Content tagline) { Element taglineElement = new Element("tagline", getFeedNamespace()); if (tagline.getType() != null) { Attribute typeAttribute = new Attribute("type", tagline.getType()); taglineElement.setAttribute(typeAttribute); } if (tagline.getValue() != null) { taglineElement.addContent(tagline.getValue()); } return taglineElement; }
protected Element generateTagLineElement(Content tagline) { Element taglineElement = new Element("tagline", getFeedNamespace()); if (tagline.getType() != null) { Attribute typeAttribute = new Attribute("type", tagline.getType()); taglineElement.setAttribute(typeAttribute); } if (tagline.getValue() != null) { taglineElement.addContent(tagline.getValue()); } return taglineElement; }
protected Element createRootElement(Channel channel) { Element root = new Element("rss",getFeedNamespace()); Attribute version = new Attribute("version", getVersion()); root.setAttribute(version); root.addNamespaceDeclaration(getContentNamespace()); generateModuleNamespaceDefs(root); return root; }
protected Element createRootElement(Feed feed) { Element root = new Element("feed",getFeedNamespace()); root.addNamespaceDeclaration(getFeedNamespace()); Attribute version = new Attribute("version", getVersion()); root.setAttribute(version); generateModuleNamespaceDefs(root); return root; }
protected Element createRootElement(Feed feed) { Element root = new Element("feed",getFeedNamespace()); root.addNamespaceDeclaration(getFeedNamespace()); Attribute version = new Attribute("version", getVersion()); root.setAttribute(version); generateModuleNamespaceDefs(root); return root; }
public void testCanDecode_NotCorrectBandType() { final Element bandInfo = new Element(DimapProductConstants.TAG_SPECTRAL_BAND_INFO); final Element filterInfo = new Element(DimapProductConstants.TAG_FILTER_BAND_INFO); final Attribute bandType = new Attribute(DimapProductConstants.ATTRIB_BAND_TYPE, "VirtualBand"); filterInfo.setAttribute(bandType); bandInfo.addContent(filterInfo); assertFalse(_persistableSpi.canDecode(bandInfo)); }
protected void populateItem(Item item, Element eItem, int index) { super.populateItem(item,eItem, index); Description description = item.getDescription(); if (description!=null && description.getType()!=null) { Element eDescription = eItem.getChild("description",getFeedNamespace()); eDescription.setAttribute(new Attribute("type",description.getType())); } eItem.removeChild("expirationDate",getFeedNamespace()); }
protected void populateItem(Item item, Element eItem, int index) { super.populateItem(item,eItem, index); Description description = item.getDescription(); if (description!=null && description.getType()!=null) { Element eDescription = eItem.getChild("description",getFeedNamespace()); eDescription.setAttribute(new Attribute("type",description.getType())); } eItem.removeChild("expirationDate",getFeedNamespace()); }
public void testCanDecode_GoodElement() { final Element bandInfo = new Element(DimapProductConstants.TAG_SPECTRAL_BAND_INFO); final Element filterInfo = new Element(DimapProductConstants.TAG_FILTER_BAND_INFO); final Attribute bandType = new Attribute(DimapProductConstants.ATTRIB_BAND_TYPE, "GeneralFilterBand"); filterInfo.setAttribute(bandType); bandInfo.setContent(filterInfo); assertTrue(_persistableSpi.canDecode(bandInfo)); }