javax.xml.stream.events.Namespace.getName()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(119)

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

Namespace.getName介绍

[英]Gets the uri bound to the prefix of this namespace
[中]获取绑定到此命名空间前缀的uri

代码示例

代码示例来源:origin: stax/stax

private static void printNamespace(Namespace a) {
  System.out.println("PREFIX: " + a.getName().getPrefix());
  System.out.println("NAMESP: " + a.getName().getNamespaceURI());
  System.out.println("NAME:   " + a.getName().getLocalPart());
  System.out.println("VALUE:  " + a.getValue());
  System.out.println("TYPE:   " + a.getDTDType());
 }
}

代码示例来源:origin: org.picketlink/picketlink-common

@SuppressWarnings("unchecked")
private String containsBaseNamespace(StartElement startElement) {
  String localPart, prefix, qual = null;
  Iterator<Namespace> namespaces = startElement.getNamespaces();
  while (namespaces != null && namespaces.hasNext()) {
    Namespace namespace = namespaces.next();
    QName name = namespace.getName();
    localPart = name.getLocalPart();
    prefix = name.getPrefix();
    if (prefix != null && prefix != "")
      qual = (localPart != null && localPart != "") ? prefix + ":" + localPart : prefix;
    if (qual != null && qual.equals("xmlns"))
      return namespace.getNamespaceURI();
  }
  return null;
}

代码示例来源:origin: org.picketlink/picketlink-core

@SuppressWarnings("unchecked")
private String containsBaseNamespace(StartElement startElement) {
  String localPart, prefix, qual = null;
  Iterator<Namespace> namespaces = startElement.getNamespaces();
  while (namespaces != null && namespaces.hasNext()) {
    Namespace namespace = namespaces.next();
    QName name = namespace.getName();
    localPart = name.getLocalPart();
    prefix = name.getPrefix();
    if (prefix != null && prefix != "")
      qual = (localPart != null && localPart != "") ? prefix + ":" + localPart : prefix;
    if (qual != null && qual.equals("xmlns"))
      return namespace.getNamespaceURI();
  }
  return null;
}

代码示例来源:origin: de.julielab/jcore-xmi-splitter

while (namespaces.hasNext()) {
  Namespace ns = (Namespace) namespaces.next();
  if (ns.getName().getPrefix().equals("xmlns")
      & ns.getName().getLocalPart().equals("types")) {
    typesNSUri = ns.getValue();
    break outerloop;

代码示例来源:origin: picketlink/picketlink

@SuppressWarnings("unchecked")
private String containsBaseNamespace(StartElement startElement) {
  String localPart, prefix, qual = null;
  Iterator<Namespace> namespaces = startElement.getNamespaces();
  while (namespaces != null && namespaces.hasNext()) {
    Namespace namespace = namespaces.next();
    QName name = namespace.getName();
    localPart = name.getLocalPart();
    prefix = name.getPrefix();
    if (prefix != null && prefix != "")
      qual = (localPart != null && localPart != "") ? prefix + ":" + localPart : prefix;
    if (qual != null && qual.equals("xmlns"))
      return namespace.getNamespaceURI();
  }
  return null;
}

代码示例来源:origin: dsukhoroslov/bagri

@SuppressWarnings("unchecked")
private void startElement(XmlParserContext ctx, StartElement element) throws BagriException {
  ctx.appendCharacters();
  
  ctx.addData(element.getName().toString()); // getLocalPart());
  ctx.addElement(); 
  for (Iterator<Namespace> itr = element.getNamespaces(); itr.hasNext();) {
    Namespace ns = itr.next();
    // TODO: process default namespace properly
    String namespace = ns.getValue();
    if (namespace != null) {
      String prefix = ns.getName().getLocalPart();
      ctx.addNamespace(prefix, namespace);
    }
  }
  for (Iterator<Attribute> itr = element.getAttributes(); itr.hasNext();) {
    Attribute a = itr.next();
    //if (!a.getName().getPrefix().isEmpty()) {
    //	String prefix = model.translateNamespace(a.getName().getNamespaceURI(), a.getName().getPrefix());
    //	ctx.addNamespace(prefix, a.getName().getNamespaceURI());
    //}
    ctx.addAttribute(a.getName(), a.getValue()); 
  }
}

代码示例来源:origin: picketlink/picketlink

@SuppressWarnings("unchecked")
private String containsBaseNamespace(StartElement startElement) {
  String localPart, prefix, qual = null;
  Iterator<Namespace> namespaces = startElement.getNamespaces();
  while (namespaces != null && namespaces.hasNext()) {
    Namespace namespace = namespaces.next();
    QName name = namespace.getName();
    localPart = name.getLocalPart();
    prefix = name.getPrefix();
    if (prefix != null && prefix != "")
      qual = (localPart != null && localPart != "") ? prefix + ":" + localPart : prefix;
    if (qual != null && qual.equals("xmlns"))
      return namespace.getNamespaceURI();
  }
  return null;
}

代码示例来源:origin: prowide/prowide-core

StringBuilder sb = new StringBuilder();
if (delayedStart != null) {
  sb.append("\n" + indent + "<" + prefix(ne.getName()) + delayedStart.getName().getLocalPart());
  delayedStart = null;

代码示例来源:origin: org.picketlink/picketlink-fed

@SuppressWarnings("unchecked")
private String containsBaseNamespace(StartElement startElement)
{
  String localPart, prefix, qual = null;
  Iterator<Namespace> namespaces = startElement.getNamespaces();
  while (namespaces != null && namespaces.hasNext())
  {
   Namespace namespace = namespaces.next();
   QName name = namespace.getName();
   localPart = name.getLocalPart();
   prefix = name.getPrefix();
   if (prefix != null && prefix != "")
     qual = (localPart != null && localPart != "") ? prefix + ":" + localPart : prefix;
   if (qual != null && qual.equals("xmlns"))
     return namespace.getNamespaceURI();
  }
  return null;
}

代码示例来源:origin: org.picketlink/picketlink-fed-core

@SuppressWarnings("unchecked")
private String containsBaseNamespace(StartElement startElement)
{
  String localPart, prefix, qual = null;
  Iterator<Namespace> namespaces = startElement.getNamespaces();
  while (namespaces != null && namespaces.hasNext())
  {
   Namespace namespace = namespaces.next();
   QName name = namespace.getName();
   localPart = name.getLocalPart();
   prefix = name.getPrefix();
   if (prefix != null && prefix != "")
     qual = (localPart != null && localPart != "") ? prefix + ":" + localPart : prefix;
   if (qual != null && qual.equals("xmlns"))
     return namespace.getNamespaceURI();
  }
  return null;
}

代码示例来源:origin: org.sbml.jsbml/jsbml-core

namespace.getName().getPrefix(),
namespace.getName().getLocalPart(),
hasAttributes, isLastNamespace,
sbmlElements.peek());
 namespace.getName().getPrefix(),
 namespace.getName().getLocalPart(),
 hasAttributes, isLastNamespace,
 sbmlElements.peek());

代码示例来源:origin: wso2/wso2-synapse

while (namespaces.hasNext()) {
  Namespace ns = (Namespace) namespaces.next();
  element.setAttributeNS(ns.getName().getNamespaceURI(), qName(ns.getName()), ns.getNamespaceURI());

代码示例来源:origin: beckchr/staxon

while (namespaces.hasNext()) {
  Namespace ns = (Namespace) namespaces.next();
  element.setAttributeNS(ns.getName().getNamespaceURI(), qName(ns.getName()), ns.getNamespaceURI());

代码示例来源:origin: org.wso2.staxon/staxon

while (namespaces.hasNext()) {
  Namespace ns = (Namespace) namespaces.next();
  element.setAttributeNS(ns.getName().getNamespaceURI(), qName(ns.getName()), ns.getNamespaceURI());

代码示例来源:origin: org.picketlink/picketlink-fed

QName name = namespace.getName();
localPart = name.getLocalPart();
prefix = name.getPrefix();

代码示例来源:origin: org.picketlink/picketlink-core

while (namespaces != null && namespaces.hasNext()) {
  Namespace namespace = namespaces.next();
  QName name = namespace.getName();
  localPart = name.getLocalPart();
  prefix = name.getPrefix();

代码示例来源:origin: org.picketlink/picketlink-fed-core

QName name = namespace.getName();
localPart = name.getLocalPart();
prefix = name.getPrefix();

代码示例来源:origin: picketlink/picketlink

while (namespaces != null && namespaces.hasNext()) {
  Namespace namespace = namespaces.next();
  QName name = namespace.getName();
  localPart = name.getLocalPart();
  prefix = name.getPrefix();

代码示例来源:origin: org.picketlink/picketlink-common

while (namespaces != null && namespaces.hasNext()) {
  Namespace namespace = namespaces.next();
  QName name = namespace.getName();
  localPart = name.getLocalPart();
  prefix = name.getPrefix();

代码示例来源:origin: picketlink/picketlink

while (namespaces != null && namespaces.hasNext()) {
  Namespace namespace = namespaces.next();
  QName name = namespace.getName();
  localPart = name.getLocalPart();
  prefix = name.getPrefix();

相关文章