From 3ebfa984c46aa1babff6c041c8c53b9472a6893e Mon Sep 17 00:00:00 2001 From: erlehmann Date: Wed, 30 Apr 2008 06:28:58 +0000 Subject: [PATCH] upload form with xforms, part2 git-svn-id: http://yolanda.mister-muffin.de/svn@333 7eef14d0-6ed0-489d-bf55-20463b2d70db --- trunk/upload.pl | 126 ++++++++++++++++++++++--------------- trunk/xsl/xhtml/upload.xsl | 9 +-- 2 files changed, 76 insertions(+), 59 deletions(-) diff --git a/trunk/upload.pl b/trunk/upload.pl index 7d17adf..6fbd2c4 100644 --- a/trunk/upload.pl +++ b/trunk/upload.pl @@ -20,88 +20,112 @@ $instance->setNamespace("http://www.w3.org/2002/xforms", "xforms"); my $video = XML::LibXML::Element->new( "video" ); -my $node = XML::LibXML::Element->new( "Title" ); -$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( "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" ); +my $node = XML::LibXML::Element->new( "abstract" ); +$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:string" ); $video->appendChild($node); -$node = XML::LibXML::Element->new( "Coverage.day" ); -$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: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 = XML::LibXML::Element->new( "alternative" ); +$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/elements/1.1/", "dc" ); +$node = XML::LibXML::Element->new( "contributor" ); +$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->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:language" ); $video->appendChild($node); -$node = XML::LibXML::Element->new( "Creator" ); -$node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); +$node = XML::LibXML::Element->new( "license" ); +$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( "Contributor" ); -$node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); +$node = XML::LibXML::Element->new( "references" ); +$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( "Publisher" ); -$node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); +$node = XML::LibXML::Element->new( "replaces" ); +$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( "Relation" ); -$node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); +$node = XML::LibXML::Element->new( "rightsHolder" ); +$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:anyURI" ); +$node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:normalizedString" ); $video->appendChild($node); -$node = XML::LibXML::Element->new( "Rights" ); -$node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); +$node = XML::LibXML::Element->new( "source" ); +$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:anyURI" ); +$node->setAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type", "xsd:normalizedString" ); $video->appendChild($node); -$node = XML::LibXML::Element->new( "Source" ); -$node->setNamespace( "http://purl.org/dc/elements/1.1/", "dc" ); +$node = XML::LibXML::Element->new( "spatial" ); +$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: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); $node = XML::LibXML::Element->new( "data" ); diff --git a/trunk/xsl/xhtml/upload.xsl b/trunk/xsl/xhtml/upload.xsl index a84eeaa..71b2f3b 100644 --- a/trunk/xsl/xhtml/upload.xsl +++ b/trunk/xsl/xhtml/upload.xsl @@ -30,7 +30,7 @@ - + - - - - - -