gpt4 book ai didi

com.helger.xml.XMLHelper.getFirstChildElementOfName()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-24 01:39:05 26 4
gpt4 key购买 nike

本文整理了Java中com.helger.xml.XMLHelper.getFirstChildElementOfName()方法的一些代码示例,展示了XMLHelper.getFirstChildElementOfName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLHelper.getFirstChildElementOfName()方法的具体详情如下:
包路径:com.helger.xml.XMLHelper
类名称:XMLHelper
方法名:getFirstChildElementOfName

XMLHelper.getFirstChildElementOfName介绍

[英]Search all child nodes of the given for the first element that has the specified tag name.
[中]搜索给定标记的所有子节点,以查找具有指定标记名的第一个元素。

代码示例

代码示例来源:origin: com.helger/peppol-commons

/**
 * Get the address contained in the passed endpoint reference.
 *
 * @param aEndpointReference
 *        The endpoint reference to retrieve the address from. May not be
 *        <code>null</code>.
 * @return The contained address.
 */
@Nullable
public static String getAddress (@Nonnull final W3CEndpointReference aEndpointReference)
{
 ValueEnforcer.notNull (aEndpointReference, "EndpointReference");
 final Element eAddress = XMLHelper.getFirstChildElementOfName (_convertReferenceToXML (aEndpointReference),
                                 "Address");
 return eAddress == null ? null : eAddress.getTextContent ();
}

代码示例来源:origin: com.helger/ph-as4-lib

@Nonnull
@ReturnsMutableCopy
private static ICommonsList <Node> _getAllReferences (@Nullable final Node aUserMessage)
{
 final ICommonsList <Node> aDSRefs = new CommonsArrayList <> ();
 Node aNext = XMLHelper.getFirstChildElementOfName (aUserMessage, "Envelope");
 if (aNext != null)
 {
  aNext = XMLHelper.getFirstChildElementOfName (aNext, "Header");
  if (aNext != null)
  {
   aNext = XMLHelper.getFirstChildElementOfName (aNext, CAS4.WSSE_NS, "Security");
   if (aNext != null)
   {
    aNext = XMLHelper.getFirstChildElementOfName (aNext, CAS4.DS_NS, "Signature");
    if (aNext != null)
    {
     aNext = XMLHelper.getFirstChildElementOfName (aNext, CAS4.DS_NS, "SignedInfo");
     if (aNext != null)
     {
      new ChildElementIterator (aNext).findAll (XMLHelper.filterElementWithNamespaceAndLocalName (CAS4.DS_NS,
                                                    "Reference"),
                           aDSRefs::add);
     }
    }
   }
  }
 }
 return aDSRefs;
}

代码示例来源:origin: com.helger/ph-as4-servlet

/**
 * Checks if the Document has a SOAPBodyPayload.
 *
 * @param aPModeLeg
 *        to get the SOAPVersion
 * @param aSOAPDoc
 *        the document that should be checked if it contains a SOAPBodyPayload
 * @return true if it contains a SOAPBodyPayload else false
 */
private static boolean _checkSOAPBodyHasPayload (@Nonnull final PModeLeg aPModeLeg, @Nonnull final Document aSOAPDoc)
{
 // Check if a SOAPBodyPayload exists
 final Element aBody = XMLHelper.getFirstChildElementOfName (aSOAPDoc.getFirstChild (),
                               aPModeLeg.getProtocol ()
                                    .getSOAPVersion ()
                                    .getBodyElementName ());
 return aBody != null && aBody.hasChildNodes ();
}

代码示例来源:origin: com.helger/peppol-commons

/**
 * Get a list of all reference parameters contained in the passed endpoint
 * reference.
 *
 * @param aEndpointReference
 *        The endpoint reference to retrieve the reference parameters. May not
 *        be <code>null</code>.
 * @return A mutable element list
 */
@Nullable
public static ICommonsList <Element> getReferenceParameters (@Nonnull final W3CEndpointReference aEndpointReference)
{
 ValueEnforcer.notNull (aEndpointReference, "EndpointReference");
 final Element eRefParams = XMLHelper.getFirstChildElementOfName (_convertReferenceToXML (aEndpointReference),
                                  "ReferenceParameters");
 if (eRefParams == null)
  return null;
 // All all child elements of ReferenceParameters :)
 return new CommonsArrayList <> (new ChildElementIterator (eRefParams));
}

代码示例来源:origin: com.helger/ph-as4-servlet

final Node aHeaderNode = XMLHelper.getFirstChildElementOfName (aSOAPDocument.getDocumentElement (),
                                eSOAPVersion.getNamespaceURI (),
                                eSOAPVersion.getHeaderElementName ());

代码示例来源:origin: com.helger/ph-as4-servlet

Element aSignedNode = XMLHelper.getFirstChildElementOfName (aSecurityNode, CAS4.DS_NS, "Signature");
if (aSignedNode != null)
 aSignedNode = XMLHelper.getFirstChildElementOfName (aSignedNode, CAS4.DS_NS, "SignedInfo");
 final Element aSignatureAlgorithm = XMLHelper.getFirstChildElementOfName (aSignedNode,
                                      CAS4.DS_NS,
                                      "SignatureMethod");
 aSignedNode = XMLHelper.getFirstChildElementOfName (aSignedNode, CAS4.DS_NS, "Reference");
 aSignedNode = XMLHelper.getFirstChildElementOfName (aSignedNode, CAS4.DS_NS, "DigestMethod");
 sAlgorithm = aSignedNode == null ? null : aSignedNode.getAttribute ("Algorithm");
 final ECryptoAlgorithmSignDigest eSignDigestAlgo = ECryptoAlgorithmSignDigest.getFromURIOrNull (sAlgorithm);

代码示例来源:origin: com.helger/ph-bdve

final String sPattern = XMLHelper.getFirstChildElementOfName (eError, "Pattern").getTextContent ();
final String sDescription = XMLHelper.getFirstChildElementOfName (eError, "Description")
                   .getTextContent ();
final String sXPath = XMLHelper.getFirstChildElementOfName (eError, "Xpath").getTextContent ();
aErrorList.add (new SVRLErrorBuilder (sPattern).setErrorLocation (new SimpleLocation (aSource.getSystemID ()))
                        .setErrorText (sDescription)

代码示例来源:origin: com.helger/ph-as4-servlet

final Node aBodyNode = XMLHelper.getFirstChildElementOfName (aRealSOAPDoc.getDocumentElement (),
                               eSOAPVersion.getNamespaceURI (),
                               eSOAPVersion.getBodyElementName ());

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com