- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.n52.security.common.xml.XMLPath.all()
方法的一些代码示例,展示了XMLPath.all()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLPath.all()
方法的具体详情如下:
包路径:org.n52.security.common.xml.XMLPath
类名称:XMLPath
方法名:all
[英]Method all, expects a xpath query resulting in a NodeList.
[中]方法all,需要xpath查询生成节点列表。
代码示例来源:origin: org.n52.security/52n-security-decision-xacml
public void debugPDPRequest(final Element request) {
StringBuilder text = new StringBuilder();
NodeList requestChildNodes = XMLPathCtx.createNew().findIn(request).all("/*[local-name() = 'Request']/*").get();
for (int i = 0; i < requestChildNodes.getLength(); i++) {
Element requestChild = (Element) requestChildNodes.item(i);
text.append(requestChild.getLocalName()).append("\n");
appendAttributes(text, XMLPathCtx.createNew().findIn(requestChild).all(".//*[local-name()='AttributeValue']").get());
}
LOG.debug("PDP request\n" + text);
}
代码示例来源:origin: org.n52.security/52n-security-enforcement-impl
/**
* Get position from feature node.
*
* @param node
* feature
* @return position as text
*/
private String getPositionFromSamplingPoint(Node node) {
NodeList nl =
ctx.findIn(node)
.all("./" + SOSInterceptorGlobals.ELEMENT_SA_POSITION + "/"
+ SOSInterceptorGlobals.ELEMENT_GML_POINT + "/"
+ SOSInterceptorGlobals.ELEMENT_GML_POS).get();
for (int i = 0; i < nl.getLength();) {
return nl.item(i).getTextContent();
}
return "0 0";
}
代码示例来源:origin: org.n52.security/52n-security-enforcement-impl
/**
* Get position from feature node.
*
* @param node
* feature
* @return position as text
*/
private String getPositionFromSamplingPoint(Node node) {
NodeList nl =
ctxResponse
.findIn(node)
.all("./" + SOSInterceptorGlobals.ELEMENT_SA_POSITION + "/"
+ SOSInterceptorGlobals.ELEMENT_GML_POINT + "/"
+ SOSInterceptorGlobals.ELEMENT_GML_POS).get();
for (int i = 0; i < nl.getLength();) {
return nl.item(i).getTextContent();
}
return "0 0";
}
代码示例来源:origin: org.n52.security/52n-security-wss
public void setOperationUrls(String opUrl) {
NodeList hrefNodes = m_xPathCtx.findIn(m_capsDoc).all("//ows:Operation/ows:DCP/ows:HTTP/*/@xlink:href").get();
for (int i = 0; i < hrefNodes.getLength(); i++) {
Node hrefNode = hrefNodes.item(i);
hrefNode.setTextContent(opUrl);
}
}
代码示例来源:origin: org.n52.security/52n-security-enforcement-impl
/**
* Get EPSG code from feature node.
*
* @param node
* feature
* @return EPSG code
*/
private String getEpsgCodeFromPosition(Node node) {
NodeList nl =
ctxResponse
.findIn(node)
.all("./" + SOSInterceptorGlobals.ELEMENT_SA_POSITION + "/"
+ SOSInterceptorGlobals.ELEMENT_GML_POINT + "/"
+ SOSInterceptorGlobals.ELEMENT_GML_POS).get();
for (int i = 0; i < nl.getLength(); i++) {
if (nl.item(i).hasAttributes()) {
NamedNodeMap attributes = nl.item(i).getAttributes();
for (int j = 0; j < attributes.getLength(); j++) {
if (attributes.item(i).getLocalName().equalsIgnoreCase(SOSInterceptorGlobals.ATTRIBUTE_SRS_NAME)) {
return attributes.item(i).getTextContent();
}
}
}
}
return "";
}
代码示例来源:origin: org.n52.security/52n-security-enforcement-impl
/**
* Get EPSG code from feature node.
*
* @param node
* feature
* @return EPSG code
*/
private String getEpsgCodeFromPosition(Node node) {
NodeList nl =
ctx.findIn(node)
.all("./" + SOSInterceptorGlobals.ELEMENT_SA_POSITION + "/"
+ SOSInterceptorGlobals.ELEMENT_GML_POINT + "/"
+ SOSInterceptorGlobals.ELEMENT_GML_POS).get();
for (int i = 0; i < nl.getLength(); i++) {
if (nl.item(i).hasAttributes()) {
NamedNodeMap attributes = nl.item(i).getAttributes();
for (int j = 0; j < attributes.getLength(); j++) {
if (attributes.item(i).getLocalName().equalsIgnoreCase(SOSInterceptorGlobals.ATTRIBUTE_SRS_NAME)) {
return attributes.item(i).getTextContent();
}
}
}
}
return "";
}
代码示例来源:origin: org.n52.security/52n-security-facade
public List<SAML2IdPMetadata> getIdPMetadata() {
XMLPathCtx xpathCtx = XMLPathCtx.createNew().addNamespace("md", "urn:oasis:names:tc:SAML:2.0:metadata");
NodeList idpList = xpathCtx.findIn(m_federationMetadata).all("//md:IDPSSODescriptor").get();
List<SAML2IdPMetadata> mdList = new ArrayList<SAML2IdPMetadata>();
for (int i = 0; i < idpList.getLength(); i++) {
Element idpSsoDescriptor = (Element) idpList.item(i);
try {
SAML2IdPMetadata idPMetadata = SAML2IdPMetadata.createFrom(idpSsoDescriptor);
mdList.add(idPMetadata);
} catch (MalformedURLException e) {
LOG.error("Skipping IDPSSODescriptor element", e);
}
}
return mdList;
}
代码示例来源:origin: org.n52.security/52n-security-decision-xacml
private void debugPDPResponse(Element response) {
StringBuilder text = new StringBuilder();
String resourceId = XMLPathCtx.createNew().findIn(response).text("//*[local-name() = 'Result']/@ResourceId").get();
String decision = XMLPathCtx.createNew().findIn(response).text("//*[local-name() = 'Result']/*[local-name() = 'Decision']/text()").get();
text.append("Resource: \t").append(resourceId ).append("\n");
text.append("Decision: \t").append(decision).append("\n");
NodeList obligationNodes = XMLPathCtx.createNew().findIn(response).all("//*[local-name() = 'Obligation']").get();
for (int i = 0; i < obligationNodes.getLength(); i++) {
Element obligationElem = (Element) obligationNodes.item(i);
String oblId = obligationElem.getAttribute("ObligationId");
String fulfillOn = obligationElem.getAttribute("FulfillOn");
text.append("Obligation: \t").append(oblId ).append("(fulfillOn:").append(fulfillOn).append(")\n");
appendAttributeAssignments(text, XMLPathCtx.createNew().findIn(obligationElem).all(".//*[local-name()='AttributeAssignment']").get());
}
LOG.debug("PDP response\n" + text);
}
代码示例来源:origin: org.n52.security/52n-security-enforcement-impl
.all("//*/ows:Operation[@name='" + entry.getKey() + "']/ows:DCP/ows:HTTP/ows:"
+ SOSInterceptorGlobals.GET).get();
for (int i = 0; i < nl.getLength(); i++) {
.all("//*/ows:Operation[@name='" + entry.getKey() + "']/ows:DCP/ows:HTTP/ows:"
+ SOSInterceptorGlobals.POST).get();
for (int i = 0; i < nl.getLength(); i++) {
代码示例来源:origin: org.n52.security/52n-security-gatekeeper
public Payload replace(String pOldURL, Transferable res, String pEncoding, String pMimeType) {
Document doc = DOMParser.createNew().parse(new InputSource(res.getPayload().getAsStream()));
XMLPathCtx ctx = XMLPathCtx.createNew();
NodeList nodes = ctx.findIn(doc).all("//OnlineResource").get();
for (int i = 0; i < nodes.getLength(); i++) {
Node node = nodes.item(i);
if (node.getParentNode().getParentNode().getLocalName().equals("HTTP")) {
String name = node.getParentNode().getLocalName();
node.getParentNode().getParentNode().replaceChild(buildReplacement(name, doc), node.getParentNode());
}
}
// WMS 1.?
// TODO extend XPath for POST nodes: //DCPType/HTTP/*[self::Get
// or self::Post]/OnlineResource
// WFS 1.1
// TODO extend XPath for POST nodes:
// //ows:Operation/ows:DCP/ows:HTTP/*[self::ows:Get or
// self::ows:Post]
// WFS 1.0
// TODO add XPath for WFS 1.0.0: //DCPType/HTTP/*[self::Get or
// self::Post]/@onlineResource
DOMSerializer serializer = DOMSerializer.createNew();
String response = serializer.serializeToString(doc);
Pattern lPattern = Pattern.compile(pOldURL.replaceAll("\\?", "\\\\?"));
Matcher mMatcher = lPattern.matcher(response);
response = mMatcher.replaceAll(m_gatekeeperURL);
sLogger.debug("Modified ResponseDocument:\n" + response);
return new TextualPayload(response, pEncoding);
}
代码示例来源:origin: org.n52.security/52n-security-decision-xacml
private void fillObligationFromElem(ObligationType obligation, Element oblElem) {
String oblId = oblElem.getAttribute("ObligationId");
String oblFulfillOn = oblElem.getAttribute("FulfillOn");
obligation.setObligationId(oblId);
obligation.setFulfillOn(EffectType.Enum.forString(oblFulfillOn));
NodeList attrAssignmentElems = xmlPathCtx.findIn(oblElem).all("./p:AttributeAssignment").get();
for (int i = 0; i < attrAssignmentElems.getLength(); i++) {
Element attAssignmentElem = (Element) attrAssignmentElems.item(i);
String attributeId = attAssignmentElem.getAttribute("AttributeId");
AttributeAssignmentType attributeAssignment = obligation.addNewAttributeAssignment();
attributeAssignment.setAttributeId(attributeId);
attributeAssignment.setDataType(attAssignmentElem.getAttribute("DataType"));
((XmlObjectBase) attributeAssignment).setStringValue("Three");
}
}
}
代码示例来源:origin: org.n52.security/52n-security-enforcement-impl
NodeList nl = ctx.findIn(doc).all("//*/ows:Operation[@name]").get();
Map<String, Node> nodesMap = new HashMap<String, Node>();
代码示例来源:origin: org.n52.metadata/smarteditor-api
innerMap.put("title", title);
innerMap.put("resourceType", lResourceType);
NodeList identifiers = context.findIn(record).all("//gmd:identificationInfo[1]/*/gmd:citation/*/gmd:identifier/*").get();
List<String> resourceIdList = new ArrayList<>();
for (int i = 0; i < identifiers.getLength(); i++) {
代码示例来源:origin: org.n52.metadata/smarteditor-api
NodeList nodes = xmlPathContextFactory.createContext().findIn(lDoc).all("//" + mMultiElementName + "/*").get();
for (int i = 0; i < nodes.getLength(); i++) {
String nodeStr = DOMUtil.nodeToString(nodes.item(i));
代码示例来源:origin: org.n52.security/52n-security-enforcement-impl
NodeList nl = ctx.findIn(doc).all("/wps:Capabilities/wps:ProcessOfferings/wps:Process/ows:Identifier/text()").get();
for (int i = 0; i < nl.getLength(); i++) {
Node processIdTextNode = nl.item(i);
代码示例来源:origin: org.n52.security/52n-security-wss
private List<AuthenticationMethod> getSupportedAuthenticationMethods() {
List<AuthenticationMethod> supportedAuthNMethods = new ArrayList<AuthenticationMethod>();
NodeList authenticationMethodList = m_xPathCtx.findIn(m_capsDoc).all("//authn:AuthenticationMethod").get();
for (int i = 0; i < authenticationMethodList.getLength(); i++) {
org.w3c.dom.Node currentAuthMethod = authenticationMethodList.item(i);
String type = m_xPathCtx.findIn(currentAuthMethod).text("@xsi:type").get();
type = type.substring(type.lastIndexOf(":") + 1);
String method = m_xPathCtx.findIn(currentAuthMethod).text("@method").get();
AuthenticationMethod supportedAuthMethod;
if (type.equals("WASType")) {
org.w3c.dom.Node accAuthNServiceNode = m_xPathCtx.findIn(currentAuthMethod).node("//authn:AuthenticationService").get();
String wasName = m_xPathCtx.findIn(accAuthNServiceNode).text("authn:Name/text()").get();
String wasUrl = m_xPathCtx.findIn(accAuthNServiceNode).text("authn:OnlineResource/@xlink:href").get();
supportedAuthMethod = new org.n52.security.authentication.WASAuthenticationMethod(wasName, wasUrl, "");
} else {
supportedAuthMethod = AuthenticationMethodFactory.getDefault().create(method);
}
supportedAuthNMethods.add(supportedAuthMethod);
}
return supportedAuthNMethods;
}
}
代码示例来源:origin: org.n52.security/52n-security-decision-xacml
private ResponseDocument convertToXACML1XmlBeanResponse(String xmlChunk) {
Document responseChunk = DOMParser.createNew().parse(new InputSource(new StringReader(xmlChunk)));
ResponseDocument responseDoc = ResponseDocument.Factory.newInstance();
ResponseType response = responseDoc.addNewResponse();
ResultType result = response.addNewResult();
result.setDecision(DecisionType.Enum.forString(xmlPathCtx.findIn(responseChunk).text("/c:Response/c:Result[1]/c:Decision/text()").get()));
result.setResourceId(xmlPathCtx.findIn(responseChunk).text("/c:Response/c:Result[1]/@ResourceId").get());
NodeList obligationNodes = xmlPathCtx.findIn(responseChunk).all("/c:Response/c:Result[1]/p:Obligations/*").get();
ObligationsType obligations;
if (obligationNodes.getLength() > 0) {
obligations = result.addNewObligations();
for (int i = 0; i < obligationNodes.getLength(); i++) {
Element oblElem = (Element) obligationNodes.item(i);
fillObligationFromElem(obligations.addNewObligation(), oblElem);
}
}
return responseDoc;
}
代码示例来源:origin: org.n52.security/52n-security-facade
public static SAML2IdPMetadata createFrom(Element idpSsoDescrElement) throws MalformedURLException {
XMLPathCtx xpathCtx = XMLPathCtx.createNew().addNamespace("md", "urn:oasis:names:tc:SAML:2.0:metadata");
NodeList nodeList = xpathCtx.findIn(idpSsoDescrElement).all("md:SingleSignOnService").get();
SAML2IdPMetadata metadata = new SAML2IdPMetadata();
for (int i = 0; i < nodeList.getLength(); i++) {
Element ssoService = (Element) nodeList.item(i);
String binding = ssoService.getAttribute("Binding");
String location = ssoService.getAttribute("Location");
metadata.addSSOBinding(binding, new URL(location));
}
Element organizationElem = (Element) xpathCtx.findIn(idpSsoDescrElement).node("./../md:Organization").get();
if (organizationElem == null) {
String entityID = xpathCtx.findIn(idpSsoDescrElement).text("./../@entityID").get();
metadata.setOrganisationDisplayName(entityID);
} else {
String idpDisplayName = xpathCtx.findIn(organizationElem).text("md:OrganizationDisplayName/text()").get();
metadata.setOrganisationDisplayName(idpDisplayName);
}
return metadata;
}
代码示例来源:origin: org.n52.metadata/smarteditor-api
private void addNodes(Node pNode, ITreeNode pTreeNode) {
ITreeNode lCurrentNode = new TreeNode();
String lValue = xmlPathContextFactory.createContext().findIn(pNode).text("value").get();
String lName = xmlPathContextFactory.createContext().findIn(pNode).text("name").get();
LOG.debug("Node name is: {}", lName);
LOG.debug("Node value is: {}", lValue);
// add to pTreeNode
if (pTreeNode.getName().equals("")) {
pTreeNode.setId(lValue);
pTreeNode.setName(lName);
pTreeNode.setType(lValue);
lCurrentNode = pTreeNode;
} else {
lCurrentNode.setId(lValue);
lCurrentNode.setName(lName);
lCurrentNode.setType(lValue);
pTreeNode.addChild(lCurrentNode);
}
lCurrentNode.setObject(new HashMap<>(getDefaultOptions()));
LOG.debug("added node with id {}", lCurrentNode.getId());
// has lChildrenList?
NodeList lChildrenList = xmlPathContextFactory.createContext().findIn(pNode).all("./node").get();
if (lChildrenList != null) {
LOG.debug("Node has ChildrenList");
for (int i = 0; i < lChildrenList.getLength(); i++) {
addNodes(lChildrenList.item(i), lCurrentNode);
}
}
LOG.debug("node has no ChildrenList");
}
代码示例来源:origin: org.n52.metadata/smarteditor-api
/**
* validates the backend bean properties against a given schematron (or else) validator
*
* @param target
* @param errors
*/
public void validate(Object target, Errors errors) {
BackendBean lBean = (BackendBean) target;
// chekc if we need to validate
if (lBean.getValidatorId() != null && !lBean.getValidatorId().equals("")) {
// apply schematron transformation
Document lReport = mService.validate(lBean.getValidatorId());
// add assertions to errors.
XMLPathCtx context = xmlPathContextFactory.createContext();
NodeList nodeList = context.findIn(lReport).all("//svrl:failed-assert").get();
for (int i = 0; i < nodeList.getLength(); i++) {
Node lNode = nodeList.item(i);
String id = context.findIn(lNode).text("@id").get();
String text = context.findIn(lNode).text("svrl:text").get();
errors.rejectValue(id,text);
}
}
}
}
我尝试理解[c代码 -> 汇编]代码 void node::Check( data & _data1, vector& _data2) { -> push ebp -> mov ebp,esp ->
我需要在当前表单(代码)的上下文中运行文本文件中的代码。其中一项要求是让代码创建新控件并将其添加到当前窗体。 例如,在Form1.cs中: using System.Windows.Forms; ..
我有此 C++ 代码并将其转换为 C# (.net Framework 4) 代码。有没有人给我一些关于 malloc、free 和 sprintf 方法的提示? int monate = ee; d
我的网络服务器代码有问题 #include #include #include #include #include #include #include int
给定以下 html 代码,将列表中的第三个元素(即“美丽”一词)以斜体显示的 CSS 代码是什么?当然,我可以给这个元素一个 id 或一个 class,但 html 代码必须保持不变。谢谢
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以便用事实和引用来回答。 关闭 7 年前。
我试图制作一个宏来避免重复代码和注释。 我试过这个: #define GrowOnPage(any Page, any Component) Component.Width := Page.Surfa
我正在尝试将我的旧 C++ 代码“翻译”成头条新闻所暗示的 C# 代码。问题是我是 C# 中的新手,并不是所有的东西都像 C++ 中那样。在 C++ 中这些解决方案运行良好,但在 C# 中只是不能。我
在 Windows 10 上工作,R 语言的格式化程序似乎没有在 Visual Studio Code 中完成它的工作。我试过R support for Visual Studio Code和 R-T
我正在处理一些报告(计数),我必须获取不同参数的计数。非常简单但乏味。 一个参数的示例查询: qCountsEmployee = ( "select count(*) from %s wher
最近几天我尝试从 d00m 调试网络错误。我开始用尽想法/线索,我希望其他 SO 用户拥有可能有用的宝贵经验。我希望能够提供所有相关信息,但我个人无法控制服务器环境。 整个事情始于用户注意到我们应用程
我有一个 app.js 文件,其中包含如下 dojo amd 模式代码: require(["dojo/dom", ..], function(dom){ dom.byId('someId').i
我对“-gencode”语句中的“code=sm_X”选项有点困惑。 一个例子:NVCC 编译器选项有什么作用 -gencode arch=compute_13,code=sm_13 嵌入库中? 只有
我为我的表格使用 X-editable 框架。 但是我有一些问题。 $(document).ready(function() { $('.access').editable({
我一直在通过本教程学习 flask/python http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-wo
我想将 Vim 和 EMACS 用于 CNC、G 代码和 M 代码。 Vim 或 EMACS 是否有任何语法或模式来处理这种类型的代码? 最佳答案 一些快速搜索使我找到了 this vim 和 thi
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 想改进这个问题?更新问题,使其成为 on-topic对于堆栈溢出。 7年前关闭。 Improve this
这个问题在这里已经有了答案: Enabling markdown highlighting in Vim (5 个回答) 6年前关闭。 当我在 Vim 中编辑包含 Markdown 代码的 READM
我正在 Swift3 iOS 中开发视频应用程序。基本上我必须将视频 Assets 和音频与淡入淡出效果合并为一个并将其保存到 iPhone 画廊。为此,我使用以下方法: private func d
pipeline { agent any stages { stage('Build') { steps { e
我是一名优秀的程序员,十分优秀!