1 17 package com.sun.org.apache.xml.internal.security.transforms.params; 18 19 20 21 import com.sun.org.apache.xml.internal.security.transforms.TransformParam; 22 import com.sun.org.apache.xml.internal.security.utils.Constants; 23 import com.sun.org.apache.xml.internal.security.utils.SignatureElementProxy; 24 import org.w3c.dom.Document ; 25 import org.w3c.dom.NodeList ; 26 import org.w3c.dom.Text ; 27 28 29 36 public class XPathContainer extends SignatureElementProxy implements TransformParam { 37 38 43 public XPathContainer(Document doc) { 44 super(doc); 45 } 46 47 52 public void setXPath(String xpath) { 53 54 if (this._constructionElement.getChildNodes() != null) { 55 NodeList nl = this._constructionElement.getChildNodes(); 56 57 for (int i = 0; i < nl.getLength(); i++) { 58 this._constructionElement.removeChild(nl.item(i)); 59 } 60 } 61 62 Text xpathText = this._doc.createTextNode(xpath); 63 this._constructionElement.appendChild(xpathText); 64 } 65 66 71 public String getXPath() { 72 return this.getTextFromTextChild(); 73 } 74 75 76 public String getBaseLocalName() { 77 return Constants._TAG_XPATH; 78 } 79 } 80 | Popular Tags |