upload form with xforms, part2

git-svn-id: http://yolanda.mister-muffin.de/svn@333 7eef14d0-6ed0-489d-bf55-20463b2d70db
This commit is contained in:
erlehmann 2008-04-30 06:28:58 +00:00
parent e757b4bab6
commit 3ebfa984c4
2 changed files with 76 additions and 59 deletions

View file

@ -20,88 +20,112 @@ $instance->setNamespace("http://www.w3.org/2002/xforms", "xforms");
my $video = XML::LibXML::Element->new( "video" ); my $video = XML::LibXML::Element->new( "video" );
my $node = XML::LibXML::Element->new( "Title" ); my $node = XML::LibXML::Element->new( "abstract" );
$node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); $node->setNamespace( "http://purl.org/dc/terms/", "dcterms" );
$node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 );
$node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:normalizedString" );
$video->appendChild($node);
$node = XML::LibXML::Element->new( "Subject" );
$node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" );
$node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 );
$node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:normalizedString" );
$video->appendChild($node);
$node = XML::LibXML::Element->new( "Description" );
$node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" );
$node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 ); $node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 );
$node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:string" ); $node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:string" );
$video->appendChild($node); $video->appendChild($node);
$node = XML::LibXML::Element->new( "Coverage.day" ); $node = XML::LibXML::Element->new( "alternative" );
$node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); $node->setNamespace( "http://purl.org/dc/terms/", "dcterms" );
$node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 );
$node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:gDay" );
$video->appendChild($node);
$node = XML::LibXML::Element->new( "Coverage.month" );
$node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" );
$node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 );
$node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:gMonth" );
$video->appendChild($node);
$node = XML::LibXML::Element->new( "Coverage.year" );
$node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" );
$node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 );
$node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:gYear" );
$video->appendChild($node);
$node = XML::LibXML::Element->new( "Coverage.placeName" );
$node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" );
$node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 ); $node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 );
$node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:normalizedString" ); $node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:normalizedString" );
$video->appendChild($node); $video->appendChild($node);
$node = XML::LibXML::Element->new( "Language" ); $node = XML::LibXML::Element->new( "contributor" );
$node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); $node->setNamespace( "http://purl.org/dc/terms/", "dcterms" );
$node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 );
$node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:normalizedString" );
$video->appendChild($node);
$node = XML::LibXML::Element->new( "created" );
$node->setNamespace( "http://purl.org/dc/terms/", "dcterms" );
$node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 );
$node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:date" );
$video->appendChild($node);
$node = XML::LibXML::Element->new( "creator" );
$node->setNamespace( "http://purl.org/dc/terms/", "dcterms" );
$node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 );
$node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:normalizedString" );
$video->appendChild($node);
$node = XML::LibXML::Element->new( "hasFormat" );
$node->setNamespace( "http://purl.org/dc/terms/", "dcterms" );
$node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 );
$node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:normalizedString" );
$video->appendChild($node);
$node = XML::LibXML::Element->new( "isFormatOf" );
$node->setNamespace( "http://purl.org/dc/terms/", "dcterms" );
$node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 );
$node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:normalizedString" );
$video->appendChild($node);
$node = XML::LibXML::Element->new( "isPartOf" );
$node->setNamespace( "http://purl.org/dc/terms/", "dcterms" );
$node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 );
$node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:normalizedString" );
$video->appendChild($node);
$node = XML::LibXML::Element->new( "language" );
$node->setNamespace( "http://purl.org/dc/terms/", "dcterms" );
$node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 ); $node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 );
$node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:language" ); $node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:language" );
$video->appendChild($node); $video->appendChild($node);
$node = XML::LibXML::Element->new( "Creator" ); $node = XML::LibXML::Element->new( "license" );
$node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); $node->setNamespace( "http://purl.org/dc/terms/", "dcterms" );
$node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 ); $node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 );
$node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:normalizedString" ); $node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:normalizedString" );
$video->appendChild($node); $video->appendChild($node);
$node = XML::LibXML::Element->new( "Contributor" ); $node = XML::LibXML::Element->new( "references" );
$node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); $node->setNamespace( "http://purl.org/dc/terms/", "dcterms" );
$node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 ); $node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 );
$node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:normalizedString" ); $node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:normalizedString" );
$video->appendChild($node); $video->appendChild($node);
$node = XML::LibXML::Element->new( "Publisher" ); $node = XML::LibXML::Element->new( "replaces" );
$node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); $node->setNamespace( "http://purl.org/dc/terms/", "dcterms" );
$node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 ); $node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 );
$node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:normalizedString" ); $node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:normalizedString" );
$video->appendChild($node); $video->appendChild($node);
$node = XML::LibXML::Element->new( "Relation" ); $node = XML::LibXML::Element->new( "rightsHolder" );
$node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); $node->setNamespace( "http://purl.org/dc/terms/", "dcterms" );
$node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 ); $node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 );
$node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:anyURI" ); $node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:normalizedString" );
$video->appendChild($node); $video->appendChild($node);
$node = XML::LibXML::Element->new( "Rights" ); $node = XML::LibXML::Element->new( "source" );
$node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); $node->setNamespace( "http://purl.org/dc/terms/", "dcterms" );
$node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 ); $node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 );
$node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:anyURI" ); $node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:normalizedString" );
$video->appendChild($node); $video->appendChild($node);
$node = XML::LibXML::Element->new( "Source" ); $node = XML::LibXML::Element->new( "spatial" );
$node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); $node->setNamespace( "http://purl.org/dc/terms/", "dcterms" );
$node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 ); $node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 );
$node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:anyURI" ); $node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:normalizedString" );
$video->appendChild($node);
$node = XML::LibXML::Element->new( "subject" );
$node->setNamespace( "http://purl.org/dc/terms/", "dcterms" );
$node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 );
$node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:normalizedString" );
$video->appendChild($node);
$node = XML::LibXML::Element->new( "temporal" );
$node->setNamespace( "http://purl.org/dc/terms/", "dcterms" );
$node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 );
$node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:date" );
$video->appendChild($node);
$node = XML::LibXML::Element->new( "title" );
$node->setNamespace( "http://purl.org/dc/terms/", "dcterms" );
$node->setNamespace( "http://www.w3.org/2001/XMLSchema-instance", "xsi", 0 );
$node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:normalizedString" );
$video->appendChild($node); $video->appendChild($node);
$node = XML::LibXML::Element->new( "data" ); $node = XML::LibXML::Element->new( "data" );

View file

@ -30,7 +30,7 @@
</textarea> </textarea>
</xsl:when> </xsl:when>
<xsl:when test="@xsi:type='xsd:gDay'"> <xsl:when test="@xsi:type='xsd:date'">
<select> <select>
<option> <option>
<xsl:value-of select="name()"/> <xsl:value-of select="name()"/>
@ -41,9 +41,6 @@
<xsl:with-param name="element">option</xsl:with-param> <xsl:with-param name="element">option</xsl:with-param>
</xsl:call-template> </xsl:call-template>
</select> </select>
</xsl:when>
<xsl:when test="@xsi:type='xsd:gMonth'">
<select> <select>
<option> <option>
<xsl:value-of select="name()"/> <xsl:value-of select="name()"/>
@ -54,9 +51,6 @@
<xsl:with-param name="element">option</xsl:with-param> <xsl:with-param name="element">option</xsl:with-param>
</xsl:call-template> </xsl:call-template>
</select> </select>
</xsl:when>
<xsl:when test="@xsi:type='xsd:gYear'">
<select> <select>
<option> <option>
<xsl:value-of select="name()"/> <xsl:value-of select="name()"/>
@ -77,7 +71,6 @@
<xsl:variable name="language" select="//@locale" /> <xsl:variable name="language" select="//@locale" />
<xsl:for-each select="$language_strings"> <xsl:for-each select="$language_strings">
<option> <option>