Beispiel #1
0
 internal static XdmItemType MakeXdmItemType(JItemType type)
 {
     if (type.isAtomicType())
     {
         return(new XdmAtomicType(((JAtomicType)type)));
     }
     else if (type is JEmptySequenceTest)
     {
         return(XdmAnyNodeType.Instance);  // TODO: need to represent this properly
     }
     else if (type is JNodeTest)
     {
         if (type is JAnyNodeType)
         {
             return(XdmAnyNodeType.Instance);
         }
         else
         {
             int kind = ((JNodeTest)type).getPrimitiveType();
             return(XdmNodeKind.ForNodeKindTest((JNodeKindTest)JNodeKindTest.makeNodeKindTest(kind)));
         }
     }
     else if (type is JAnyItemType)
     {
         return(XdmAnyItemType.Instance);
     }
     else if (type is JFunctionItemType)
     {
         return(XdmAnyFunctionType.Instance);
     }
     else
     {
         return(null);
     }
 }
Beispiel #2
0
        internal static XdmItemType MakeXdmItemType(JItemTypeType type)
        {
            if (type is JAtomicType)
            {
                XdmAtomicType itype = XdmAtomicType.BuiltInAtomicType(QName.FromStructuredQName(((JAtomicType)type).getStructuredQName()));

                return(itype);
            }
            else if (type is JErrorType)
            {
                return(XdmAnyNodeType.Instance);  // TODO: need to represent this properly
            }
            else if (type is JNodeTest)
            {
                if (type is JAnyNodeType)
                {
                    return(XdmAnyNodeType.Instance);
                }
                else
                {
                    int kind = ((JNodeTest)type).getPrimitiveType();
                    return(XdmNodeKind.ForNodeKindTest((JNodeKindTest)JNodeKindTest.makeNodeKindTest(kind)));
                }
            }
            else if (type is JAnyMapType)
            {
                return(XdmAnyMapType.Instance);
            }
            else if (type is JAnyArrayType)
            {
                return(XdmAnyArrayType.Instance);
            }
            else if (type is JAnyItemType)
            {
                return(XdmAnyItemType.Instance);
            }
            else if (type is JFunctionItemType)
            {
                return(XdmAnyFunctionType.Instance);
            }
            else
            {
                return(null);
            }
        }