예제 #1
0
파일: vm.c 프로젝트: graue/intp
s v execcmd(t cmd *cd, i cp) /* cp -> can postpone */
{
	if (cd->ctyp == CMDCALL)
	{
		if (cp) todo = cd->arg.str;
		l callwd(cd->arg.str);
	}
	l if (cd->ctyp == CMDNUM)
		push(sk, vjfromnum(cd->arg.num));
	l /* CMDSTR */
		push(sk, vjfromstr(xsd(cd->arg.str)));
}
예제 #2
0
Schema Schema::from_xml(std::string const& xml)
{
#ifdef PDAL_HAVE_LIBXML2
    
    std::string xsd("");
    
    pdal::schema::Reader reader(xml, xsd);
    
    pdal::Schema schema = reader.getSchema();
    return schema;

#else
    boost::ignore_unused_variable_warning(xml);
    return Schema();
#endif
}
예제 #3
0
void XsltTransformViewer::onLoad()
{
	ViewerBase::onLoad();

	shared_ptr<XMLNode> root = getModuleDocument()->getRoot();
	if(root != nullptr)
	{
		String xmlStr = root->getAttributeString(OS_MODULES_XSLTTRANSFORM_XML);
		String xslStr = root->getAttributeString(OS_MODULES_XSLTTRANSFORM_XSL);
		String xsdStr = root->getAttributeString(OS_MODULES_XSLTTRANSFORM_XSD);

		shared_ptr<XMLDocument> document;

		if(xsdStr.empty())
		{
			document.reset(OS_NEW XMLDocument());
		}
		else
		{
			shared_ptr<XMLSchema> xsd(OS_NEW XMLSchema());
			xsd->parseString(xsdStr);

			document.reset(OS_NEW XMLDocument(xsd));
		}

		if(document->parseString(xmlStr))
		{
			shared_ptr<XMLStylesheet> transformer(OS_NEW XMLStylesheet());
			// Inizializza le funzioni del template
			getPage()->initStylesheet(transformer);

			if(transformer->parseString(xslStr))
			{
				String output;
				if(transformer->applyToString(document, output))
				{
					getControls()->add(shared_ptr<HtmlLiteral>(OS_NEW HtmlLiteral(getPage()->parseOml(output, true, false, false, omlRenderModeOsiris, getInstance().getString()))));
				}
			}
		}
	}
}
예제 #4
0
파일: cmap.c 프로젝트: RushOnline/bouquet
/* generate map definition */
void map_decl(symbol_t *sp, list_t *stmts)
{
    FILE *tmp;

    if (sp == NULL) return;
    if (sp->ptype == NULL) 
        fatal("Internal error CM%d: Map without type information", __LINE__);
	
    if (cpp())
        c_out("\nclass %s {\n", sp->name);
    else if (java())
        c_out("\npublic class %s {\n", sp->name); 
    else if (xsd()) {
        c_out("\n<xsd:complexType name=\"%s\">\n", sp->name);
    	c_identlevel++;
		c_outi("<xsd:sequence>\n");
    }
    
    c_identlevel++;

    /* if doing C++, declare nextvlc()/getvlc()/putvlc() and switch output files */
    if (cpp()) {
        /* nextvlc(), getvlc() */
        if (gen_get) {
            c_outi("public: static int nextvlc(%s &%sbs, %s%s *%sarg, int *%sparse=NULL, int *%scode=NULL);\n",
                   bitstream_class, prefix, 
                   ((sp->modifiers & M_UNSIGNED) ? "unsigned " : ""),
                   sp->ptype->name, prefix, prefix, prefix);
            c_outi("public: static int getvlc(%s &%sbs, %s%s *%sarg, int *%sparse=NULL, int *%scode=NULL);\n",
                   bitstream_class, prefix, 
                   ((sp->modifiers & M_UNSIGNED) ? "unsigned " : ""),
                   sp->ptype->name, prefix, prefix, prefix);
        }
        /* putvlc() */
        if (gen_put) {
			if (sp->ptype->ident == CLASS_TYPE)
				/* if CLASS_TYPE pass a pointer to argument */
				c_outi("public: static int putvlc(%s &%sbs, %s%s *%sarg, int *%sparse=NULL, int *%scode=NULL);\n",
                       bitstream_class, prefix, 
                       ((sp->modifiers & M_UNSIGNED) ? "unsigned " : ""),
                       sp->ptype->name, prefix, prefix, prefix);
			else
				/* otherwise, just value */
				c_outi("public: static int putvlc(%s &%sbs, %s%s %sarg, int *%sparse=NULL, int *%scode=NULL);\n",
                       bitstream_class, prefix, 
                       ((sp->modifiers & M_UNSIGNED) ? "unsigned " : ""),
                       sp->ptype->name, prefix, prefix, prefix);

        }
        /* putxml() */
        if (gen_putxml) {
            c_outi("public: static int putxml(%s &%sbs, short int bAttr, %s%s *%sarg, int *%sparse=NULL, int *%scode=NULL);\n",
                   bitstream_class, prefix, 
                   ((sp->modifiers & M_UNSIGNED) ? "unsigned " : ""),
                   sp->ptype->name, prefix, prefix, prefix);
        }
        c_identlevel = 0;
        tmp = ofp;
        ofp = ofp2;
    }

    if (cpp() || java()) {
	    /* generate getvlc function; no next, if the map uses escape */
	    if (gen_get && !sp->escape) 
            c_map_next(sp, stmts);
        /* generate getvlc function */
        if (gen_get) 
            c_map_get(sp, stmts);
        /* generate putvlc function */
        if (gen_put) 
            c_map_put(sp, stmts);
        /* generate putxml function */
        if (gen_putxml) 
            c_map_putxml(sp, stmts);
    }
	else if (xsd()) 
        c_map_xsd(sp, stmts);

    /* switch back to .h file */
    if (cpp()) {
        c_identlevel = 1;
        ofp = tmp;
    }

    c_identlevel--;

    if (cpp()) 
        c_out("};\n");
    else if (java())
        c_out("}\n");
    else if (xsd()) {
		c_outi("</xsd:sequence>\n");
		c_identlevel--;
        c_out("</xsd:complexType>\n");
    }
}
예제 #5
0
TEST(XSDTest, XSDLoadElementCount) {
    ::wsdl2cpp::lib::xsd::XSD xsd("lib/xsd/test/data/basic.xsd");

    EXPECT_EQ((unsigned int)4, xsd.get_ElementNames().size());
}
예제 #6
0
TEST(XSDTest, XSDLoadComplexTypeCount) {
    ::wsdl2cpp::lib::xsd::XSD xsd("lib/xsd/test/data/basic.xsd");

    EXPECT_EQ((unsigned int)2, xsd.get_ComplexTypeNames().size());
}