Examples of XmlStruct


Examples of org.xooof.xmlstruct.XmlStruct

        XmlStructFactory sf = new XmlStructFactoryComposite(new XmlStructFactory[]{
            new org.xooof.xmlstruct.test.nons.PackageXmlStructFactory(),
            new org.xooof.xmlstruct.test.ns1.PackageXmlStructFactory(),
            new org.xooof.xmlstruct.test.ns2.PackageXmlStructFactory(),
            });
        XmlStruct xs = null;
        ErrorBag eb = new ErrorBag();
           

        FileWriter rw = new FileWriter(result);
        SAXTransformerFactory tf = (SAXTransformerFactory)SAXTransformerFactory.newInstance();
        TransformerHandler handler = tf.newTransformerHandler();
        handler.setResult(new StreamResult(rw));
        try
        {
            handler.startDocument();
            startElement(handler,"result");
           
            // xsFromXML
            try
            {
                FileInputStream fis = new FileInputStream(source);
                xs = XmlStructUtils.xsFromXML(sf,fis,eb,"");
                if (eb.size() > 0)
                {
                    writeElementString(handler,"fromXmlErr",eb.toString());
                    return;
                }
                else
                {
                    writeElementString(handler,"fromXmlOk","");
                }
            }
            catch(XmlStructException e)
            {
                writeElementString(handler,"fromXmlErr",e.getMessage());
                return;
            }
            catch(Exception e)
            {
                writeElementString(handler,"fromXmlErr","Fatal: "+e.toString());  
                return;
            }
           
            // xsValidate
            {
                xs.xsValidate(eb,"");
                if (eb.size() > 0)
                {
                    writeElementString(handler,"validateErr",eb.toString());
                }
                else
View Full Code Here

Examples of org.xooof.xmlstruct.XmlStruct

    try
    {
      if (xml != null && xml.length() > 0)
      {
        ErrorBag eb = new ErrorBag();
        XmlStruct o = XmlStructUtils.xsFromXML(xsFactory,xml,eb,"");
        if (o == null)
        {
          throw new XmlStructException("unmarshalling error: " + eb.toString());
        }
        else
View Full Code Here

Examples of railo.runtime.text.xml.struct.XMLStruct

              list.add(it.next());
            }
            return list;
        }
        else if(o instanceof XMLStruct) {
            XMLStruct sct=((XMLStruct)o);
            if(sct instanceof XMLMultiElementStruct) return toList(new XMLMultiElementArray((XMLMultiElementStruct) o));
            ArrayList list=new ArrayList();
            list.add(sct);
            return list;
        }
        else if(o instanceof ObjectWrap) {
            return toList(((ObjectWrap)o).getEmbededObject());
        }
        else if(o instanceof Struct) {
            Struct sct=(Struct) o;
            ArrayList arr=new ArrayList();
           
            Iterator<Entry<Key, Object>> it = sct.entryIterator();
            Entry<Key, Object> e=null;
            try {
                while(it.hasNext()) {
                  e = it.next();
                    arr.add(toIntValue(e.getKey().getString()),e.getValue());
View Full Code Here

Examples of railo.runtime.text.xml.struct.XMLStruct

          XMLMultiElementStruct xmes;
          if(o instanceof XMLMultiElementStruct) {
            xmes=(XMLMultiElementStruct)o;
          }
          else {
            XMLStruct sct=(XMLStruct) o;
              Array a=new ArrayImpl();
              a.append(o);
              xmes=new XMLMultiElementStruct(a, sct.getCaseSensitive());
          }
        return new XMLMultiElementArray(xmes);
        }
        else if(o instanceof ObjectWrap) {
            return toArray(((ObjectWrap)o).getEmbededObject());
        }
        else if(o instanceof Struct) {
            Struct sct=(Struct) o;
            Array arr=new ArrayImpl();
           
            Iterator<Entry<Key, Object>> it = sct.entryIterator();
            Entry<Key, Object> e=null;
            try {
                while(it.hasNext()) {
                  e = it.next();
                    arr.setE(toIntValue(e.getKey().getString()),e.getValue());
View Full Code Here

Examples of railo.runtime.text.xml.struct.XMLStruct

        }
        else if(o instanceof List) {
            return ((List) o).toArray();
        }
        else if(o instanceof XMLStruct) {
            XMLStruct sct=((XMLStruct)o);
            if(sct instanceof XMLMultiElementStruct) return toNativeArray((sct));
            Object[] a=new Object[1];
            a[0]=sct;
            return a;
        }
        else if(o instanceof ObjectWrap) {
            return toNativeArray(((ObjectWrap)o).getEmbededObject());
        }
        else if(o instanceof Struct) {
            Struct sct=(Struct) o;
            Array arr=new ArrayImpl();
           
            Iterator<Entry<Key, Object>> it = sct.entryIterator();
            Entry<Key, Object> e=null;
            try {
                while(it.hasNext()) {
                  e=it.next();
                    arr.setE(toIntValue(e.getKey().getString()),e.getValue());
View Full Code Here

Examples of railo.runtime.text.xml.struct.XMLStruct

    public XMLNodeList(Node parent, boolean caseSensitive) {
      this(parent,caseSensitive,null);
    }
    public XMLNodeList(Node parent, boolean caseSensitive, String filter) {
        if(parent instanceof XMLStruct) {
            XMLStruct xmlNode = ((XMLStruct)parent);
            this.parent=xmlNode.toNode();
            this.caseSensitive=xmlNode.getCaseSensitive();
        }
        else {
            this.parent=parent;
            this.caseSensitive=caseSensitive;
        }
View Full Code Here

Examples of railo.runtime.text.xml.struct.XMLStruct

    else {
      List<Node> children = XMLUtil.getChildNodesAsList(node,Node.ELEMENT_NODE,caseSensitive,null);
      int len=children.size();
      Array array=null;//new ArrayImpl();
      Element el;
      XMLStruct sct=null,first=null;
      for(int i=0;i<len;i++) {
        el=(Element) children.get(i);// XMLCaster.toXMLStruct(getChildNode(index),caseSensitive);
        if(XMLUtil.nameEqual(el,k.getString(),caseSensitive)) {
          sct = XMLCaster.toXMLStruct(el,caseSensitive);
         
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.