New to Chiba

View: New views
2 Messages — Rating Filter:   Alert me  

New to Chiba

by jklcom99 () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
I just found out about Chiba today.  I was looking for a way to transcode and style my xforms files.  All I want to do is to pass Chiba an Xforms file that points to some external data files and have it transcode and style for the targeted client.  I would like to incorporate it into my app by newing up a ChibaBean and set it up for processing the file.  Does any one have an examples on how to use/setup ChibaBean in an app?  

Thanks

Re: New to Chiba

by jklcom99 () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm getting uri resolution failed when trying to create a ChibaBean.  Am I setting the baseURI correctly?

ERROR org.chiba.xml.xforms.XFormsElement : [xforms:model:Test] link exception: /forms/hello.xml
ERROR org.chiba.xml.xforms.Container : dispatch: exception during event flow
org.chiba.xml.xforms.exception.XFormsLinkException: uri resolution failed

code snippet
                chibaBean = new ChibaBean();
                InputStream is = new FileInputStream(xformsFile);
                chibaBean.setXMLContainer(is);
                chibaBean.setBaseURI("http://localhost:8081/forms/");
                chibaBean.init();


hello.xhtml

<?xml version="1.0" encoding="UTF-8"?>
<xhtml:html xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xhtml:head>
        <xhtml:title>Hello World in XForms</xhtml:title>
        <xforms:model id="Test" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <xforms:instance src="/forms/hello.xml>
            </xforms:instance>
        </xforms:model>
    </xhtml:head>
    <xhtml:body>
        <xforms:input incremental="false" ref="PersonGivenName">
            <xforms:label>Please enter your first name: </xforms:label>
        </xforms:input>
        <xforms:output value="concat('Hello ', PersonGivenName, '!')">
            <xforms:label>Output: </xforms:label>
        </xforms:output>
    </xhtml:body>
</xhtml:html>

LightInTheBox - Buy quality products at wholesale price!