Examples of prefixForNamespace()


Examples of org.apache.xmlbeans.XmlCursor.prefixForNamespace()

    */
   public static void setValueAsQName( XmlObject xBean,
                                       QName     qName )
   {
      XmlCursor xCursor = xBean.newCursor(  );
      String    prefix = xCursor.prefixForNamespace( qName.getNamespaceURI(  ) );
      String    value  = prefix + ":" + qName.getLocalPart(  );
      xCursor.setTextValue( value );
      xCursor.dispose(  );
   }

View Full Code Here

Examples of org.apache.xmlbeans.XmlCursor.prefixForNamespace()

                XmlQName xqname = XmlQName.Factory.newValue(value);

                org.apache.xmlbeans.impl.xb.xsdschema.NoFixedFacet enumSElem = restriction.addNewEnumeration();
                XmlCursor xc  = enumSElem.newCursor();

                String newPrefix = xc.prefixForNamespace(value.getNamespaceURI());
                xc.dispose();

                enumSElem.setValue( XmlQName.Factory.newValue(
                    new QName(value.getNamespaceURI(), value.getLocalPart(), newPrefix)));
            }
View Full Code Here

Examples of org.apache.xmlbeans.XmlCursor.prefixForNamespace()

   
    private static final String formatQName(XmlCursor xmlc, QName qName)
    {
        XmlCursor parent = xmlc.newCursor();
        parent.toParent();
        String prefix = parent.prefixForNamespace(qName.getNamespaceURI());
        parent.dispose();
        String name;
        if (prefix == null || prefix.length() == 0)
            name = qName.getLocalPart();
        else
View Full Code Here

Examples of org.apache.xmlbeans.XmlCursor.prefixForNamespace()

    }

    private static final String formatQName(XmlCursor xmlc, QName qName) {
        XmlCursor parent = xmlc.newCursor();
        parent.toParent();
        String prefix = parent.prefixForNamespace(qName.getNamespaceURI());
        parent.dispose();
        String name;
        if (prefix == null || prefix.length() == 0) {
            name = qName.getLocalPart();
        } else {
View Full Code Here

Examples of org.apache.xmlbeans.XmlCursor.prefixForNamespace()

            if (annotation != null) {
                XmlObject[] userInformation = annotation.getUserInformation();
                if (userInformation != null && userInformation.length > 0) {
                    XmlObject xmlObject = userInformation[0];
                    XmlCursor cursor = xmlObject.newCursor();
                    xsPrefix = cursor.prefixForNamespace("http://www.w3.org/2001/XMLSchema");
                    cursor.dispose();

                    result = xmlObject.xmlText(); // XmlUtils.getElementText( (
                    // Element )
                    // userInformation[0].getDomNode());
View Full Code Here

Examples of org.apache.xmlbeans.XmlCursor.prefixForNamespace()

        if (result == null && schemaType != null && schemaType.getAnnotation() != null) {
            XmlObject[] userInformation = schemaType.getAnnotation().getUserInformation();
            if (userInformation != null && userInformation.length > 0 && userInformation[0] != null) {
                XmlObject xmlObject = userInformation[0];
                XmlCursor cursor = xmlObject.newCursor();
                xsPrefix = cursor.prefixForNamespace("http://www.w3.org/2001/XMLSchema");
                cursor.dispose();
                result = xmlObject.xmlText(); // = XmlUtils.getElementText( (
                // Element )
                // userInformation[0].getDomNode());
            }
View Full Code Here

Examples of org.apache.xmlbeans.XmlCursor.prefixForNamespace()

      }

      XmlCursor cursor = m_context.newCursor(  );
      try
      {
         return cursor.prefixForNamespace( namespaceURI );
      }
      finally
      {
         cursor.dispose(  );
      }
View Full Code Here

Examples of org.apache.xmlbeans.XmlCursor.prefixForNamespace()

    */
   public static void setValueAsQName( XmlObject xBean,
                                       QName     qName )
   {
      XmlCursor xCursor = xBean.newCursor(  );
      String    prefix = xCursor.prefixForNamespace( qName.getNamespaceURI(  ) );
      String    value  = prefix + ":" + qName.getLocalPart(  );
      xCursor.setTextValue( value );
      xCursor.dispose(  );
   }

View Full Code Here

Examples of org.apache.xmlbeans.XmlCursor.prefixForNamespace()

   {
      StringBuffer strBuf = new StringBuffer(  );
      if ( StringUtils.isNotEmpty( topicPath.getNamespaceURI(  ) ) )
      {
         XmlCursor xCursor = targetXBean.newCursor(  );
         String    prefix = xCursor.prefixForNamespace( topicPath.getNamespaceURI(  ) );
         xCursor.dispose(  );
         strBuf.append( prefix );
         strBuf.append( ':' );
      }
View Full Code Here

Examples of org.apache.xmlbeans.XmlCursor.prefixForNamespace()

   {
      QueryExpressionDocument queryExpressionDocument = QueryExpressionDocument.Factory.newInstance(  );
      QueryExpressionType     queryExpressionType = queryExpressionDocument.addNewQueryExpression(  );
      XmlBeanUtils.setValueAsQName( queryExpressionType, SushiPropertyQNames.AKAGI );
      XmlCursor xCursor = queryExpressionType.newCursor(  );
      String    prefix = xCursor.prefixForNamespace( SushiPropertyQNames.AKAGI.getNamespaceURI(  ) );
      String    value  = xCursor.getTextValue(  );
      assertEquals( prefix + ":" + SushiPropertyQNames.AKAGI.getLocalPart(  ), value );
   }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.