/[suikacvs]/messaging/manakai/lib/Message/Markup/Atom.dis
Suika

Diff of /messaging/manakai/lib/Message/Markup/Atom.dis

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.13 by wakaba, Sun Sep 10 11:19:24 2006 UTC revision 1.17 by wakaba, Sun Nov 5 09:16:30 2006 UTC
# Line 77  Namespace: Line 77  Namespace:
77      http://suika.fam.cx/~wakaba/archive/2004/dom/xdt#      http://suika.fam.cx/~wakaba/archive/2004/dom/xdt#
78    @DOMMain:    @DOMMain:
79      http://suika.fam.cx/~wakaba/archive/2004/dom/main#      http://suika.fam.cx/~wakaba/archive/2004/dom/main#
80      @domperl:
81        http://suika.fam.cx/~wakaba/archive/2006/dom/perl/
82    @dx:    @dx:
83      http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException#      http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException#
84    @dxm:    @dxm:
# Line 119  Namespace: Line 121  Namespace:
121      http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/Element/      http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/Element/
122    @test:    @test:
123      http://suika.fam.cx/~wakaba/archive/2004/dis/Test#      http://suika.fam.cx/~wakaba/archive/2004/dis/Test#
124      @thr:
125        http://purl.org/syndication/thread/1.0
126    @tx:    @tx:
127      http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/XML/      http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/XML/
128    @urigen:    @urigen:
# Line 270  ElementTypeBinding: Line 274  ElementTypeBinding:
274        @@@@: s|ElementType        @@@@: s|ElementType
275        @@@ForCheck: s|ForML        @@@ForCheck: s|ForML
276    
     @@f:implements: AtomFeature10  
   
277  ElementTypeBinding:  ElementTypeBinding:
278    @Name: IFClsDef    @Name: IFClsDef
279    @ElementType:    @ElementType:
# Line 300  ElementTypeBinding: Line 302  ElementTypeBinding:
302        @@@ContentType: DISCore|TFPQNames        @@@ContentType: DISCore|TFPQNames
303        @@@ForCheck: ManakaiDOM|ForClass ManakaiDOM|ManakaiDOMLatest        @@@ForCheck: ManakaiDOM|ForClass ManakaiDOM|ManakaiDOMLatest
304    
     @@f:implements: AtomFeature10  
   
305  ElementTypeBinding:  ElementTypeBinding:
306    @Name: IFClsConstructDef    @Name: IFClsConstructDef
307    @ElementType:    @ElementType:
# Line 341  ElementTypeBinding: Line 341  ElementTypeBinding:
341        @@@@: mv|ElementContentModel        @@@@: mv|ElementContentModel
342        @@@ForCheck: mv|ForCM        @@@ForCheck: mv|ForCM
343    
     @@f:implements: AtomFeature10  
344    
345  ElementTypeBinding:  ElementTypeBinding:
346    @Name: IFQName    @Name: IFQName
# Line 568  FeatureDef: Line 567  FeatureDef:
567      @@enDesc:      @@enDesc:
568        The Atom DOM, version 1.0.        The Atom DOM, version 1.0.
569    
570    FeatureDef:
571      @featureQName: fe|AtomThreading
572      @QName: AtomThreadingFeature
573      @FeatureVerDef:
574        @@QName: AtomThreadingFeature10
575        @@Version: 1.0
576        @@f:instanceOf: AtomThreadingFeature
577        @@f:requires: fe|AtomFeature10
578        @@enDesc:
579          The Atom Threading Extension DOM, version 1.0.
580    
581  ## -- Modules  ## -- Modules
582    
583  ModuleSetDef:  ModuleSetDef:
# Line 700  IFClsDef: Line 710  IFClsDef:
710    @IFQName: AtomImplementation    @IFQName: AtomImplementation
711    @ClsQName: ManakaiAtomImplementation    @ClsQName: ManakaiAtomImplementation
712    
713    @IFISA: c|DOMImplementation    @domperl:implementedByObjectsOf: c|DOMImplementation
714    @ClsISA: c|ManakaiDOMImplementation    @domperl:classImplementedByObjectsOf: c|ManakaiDOMImplementation
715    
716    @enDesc:    @enDesc:
717      The <IF::AtomImplementation> interface provides convenience      The <IF::AtomImplementation> interface provides convenience
718      methods to create Atom documents.      methods to create Atom documents.
719    
720    @f:provides: AtomFeature10    @f:provides: AtomFeature10
721      @f:implements: AtomFeature10
722    
723    @Test:    @Test:
724      @@QName: AtomImplementation.interface.test      @@QName: AtomImplementation.interface.test
# Line 716  IFClsDef: Line 727  IFClsDef:
727          <IFName::AtomImplementation>,          <IFName::AtomImplementation>,
728          <IFName::AtomImplementation||ManakaiDOM|ManakaiDOM>,          <IFName::AtomImplementation||ManakaiDOM|ManakaiDOM>,
729          <IFName::c|DOMImplementation>,          <IFName::c|DOMImplementation>,
         <IFName::urigen|URIImplementation>,  
         <IFName::f|MinimumImplementation>,  
730          <IFName::f|GetFeature>,          <IFName::f|GetFeature>,
731        ) {        ) {
732          $test->id ($interface);          $test->id ($interface);
733          $test->assert_true          $test->assert_true
734                   (<Class::ManakaiAtomImplementation>->isa ($interface));                   (<Class::c|ManakaiDOMImplementation>->isa ($interface));
735        }        }
736    @Test:    @Test:
737      @@QName: ImplementationRegistry.AtomImplementation.1.test      @@QName: ImplementationRegistry.AtomImplementation.1.test
# Line 1512  IFClsDef: Line 1521  IFClsDef:
1521          <QUOTE::reflecting Date child element> attribute should          <QUOTE::reflecting Date child element> attribute should
1522          be provided for published and created?          be provided for published and created?
1523        }        }
1524    
1525      @CODE:
1526        @@QName: getReflectAttrNonNegativeIntegerValue
1527        @@enDesc:
1528          {P:: If a DOM attribute is defined to <DFN::reflect the
1529               non-negative integer value of the <VAR::attr-name> attribute>
1530               of the node <VAR::E>, the getter of the attribute <kwd:MUST>
1531               return the value defined by the algorithm:
1532    
1533            {OLI:: If the <VAR::E> contains an attribute node <VAR::A> whose name
1534                   is <VAR::attr-name>:
1535    
1536              = If the <A::Node.nodeValue> of the <VAR::A> is
1537                one or more sequence of digits (<CHAR::DIGIT ZERO>,
1538                <CHAR::DIGIT ONE>, ..., <CHAR::DIGIT NINE>) optionally
1539                preceding by a <CHAR::PLUS SIGN>, then
1540                the attribute getter <kwd:MUST> return a value
1541                by interpreting the <A::Node.nodeValue> of the <VAR::A>
1542                as a decimal number.
1543    
1544            }
1545    
1546            = If a default value is explicitly defined
1547              where this algorithm is referenced, it <kwd:MUST>
1548              return the default value.
1549    
1550            = Otherwise, it <kwd:MUST> return a binding-specific
1551              default value, if it is defined by the specification
1552              of the binding, or <DOM::-1>.
1553    
1554          }
1555    
1556            {NOTE::
1557              In Atom Threading Extension <SRC::RFC 4685>,
1558              the <CHAR::PLUS SIGN> and leading <CHAR::DIGIT ZERO>s
1559              are prohibitted.
1560            }
1561        @@PerlDef:
1562          __DEEP{
1563            E: {
1564              $r = $node-><M::Element.getAttributeNS> ($namespaceURI, $localName);
1565              if (defined $r) {
1566                if ($r =~ /\A\+?([0-9]+)\z/) {
1567                  $r = 0+$1;
1568                  last E;
1569                }
1570              }
1571    
1572              $r = $defaultValue;
1573              $r = -1 unless defined $r;
1574            } # E
1575          }__;
1576    
1577      @CODE:
1578        @@QName: setReflectAttrNonNegativeIntegerValue
1579        @@enDesc:
1580          {P:: If a DOM attribute is defined to <DFN::reflect the
1581               non-negative integer value
1582               of the <VAR::attr-name> attribute> of the node <VAR::E>,
1583               the setter of the attribute <kwd:MUST> modify the node as
1584               defined by the algorithm:
1585    
1586            = If the given value is <DOM::-1> or one of binding-specific
1587              default values, if any, as defined by the specification
1588              of the binding, it <kwd:MUST>
1589              remove the <VAR::attr-name> attribute node, if any,
1590              from the list of attribute nodes of <VAR::E>.
1591    
1592            = Otherwise, it <kwd:MUST> set the <VAR::attr-name>
1593              attribute node value to a string representation
1594              of the given value as if
1595              the <M::Element.setAttributeNS> method were invoked.
1596              The string representation <kwd:MUST> be a decimal
1597              number consist of one or more sequence of digits
1598              (<CHAR::DIGIT ZERO>, <CHAR::DIGIT ONE>, ..., <CHAR::DIGIT NINE>)
1599              <EM::without> any leading <CHAR::DIGIT ZERO>.
1600              The <CHAR::PLUS SIGN> <kwd:MUST> be omitted.
1601    
1602          }
1603    
1604            {NOTE::
1605              It might throw an exception.
1606            }
1607        @@PerlDef:
1608          __DEEP{
1609            if (defined $given and $given >= 0) {
1610              $node-><M::Element.setAttributeNS>
1611                       ($namespaceURI, $localName, 0+$given);
1612            } else {
1613              $node-><M::Element.removeAttributeNS> ($namespaceURI, $localName);
1614            }
1615          }__;
1616  ##AtomImplementation  ##AtomImplementation
1617    
1618  IFClsDef:  IFClsDef:
1619    @IFQName: AtomDocument    @IFQName: AtomDocument
1620    @ClsQName: ManakaiAtomDocument    @ClsQName: ManakaiAtomDocument
1621    
1622    @IFISA: Document    @domperl:implementedByObjectsOf: Document
1623    @ClsISA: td|ManakaiDOMDocument    @domperl:classImplementedByObjectsOf: td|ManakaiDOMDocument
1624    
1625    @s:rootElementType: AnyAtomElement||ManakaiDOM|all    @f:implements: AtomFeature10
1626    
1627    @enDesc:    @enDesc:
1628      If the <Feature::fe|Atom> feature version <FeatureVer::1.0>      If the <Feature::fe|Atom> feature version <FeatureVer::1.0>
# Line 1549  IFClsDef: Line 1650  IFClsDef:
1650    @IFQName: AtomFeedDocument    @IFQName: AtomFeedDocument
1651    @ClsQName: ManakaiFeedEntryDocument    @ClsQName: ManakaiFeedEntryDocument
1652    
1653    @IFISA: AtomDocument    @domperl:implementedByObjectsOf: Document
1654    @ClsISA: ManakaiAtomDocument    @domperl:classImplementedByObjectsOf: td|ManakaiDOMDocument
1655    
1656    @s:rootElementType:    @f:implements: AtomFeature10
     @@@: atom|feed  
     @@DISCore:stopISARecursive: 1  
1657    
1658    @enDesc:    @enDesc:
1659      The <IF::AtomFeedDocument> interface provides convenience      The <IF::AtomFeedDocument> interface provides convenience
# Line 1586  IFClsDef: Line 1685  IFClsDef:
1685    @IFQName: AtomEntryDocument    @IFQName: AtomEntryDocument
1686    @ClsQName: ManakaiAtomEntryDocument    @ClsQName: ManakaiAtomEntryDocument
1687    
1688    @IFISA: AtomDocument    @domperl:implementedByObjectsOf: Document
1689    @ClsISA: ManakaiAtomDocument    @domperl:classImplementedByObjectsOf: td|ManakaiDOMDocument
1690    
1691    @s:rootElementType:    @f:implements: AtomFeature10
     @@@: atom|entry  
     @@DISCore:stopISARecursive: 1  
1692    
1693    @enDesc:    @enDesc:
1694      The <IF::AtomEntryDocument> interface provides convenience      The <IF::AtomEntryDocument> interface provides convenience
# Line 1730  IFClsDef: Line 1827  IFClsDef:
1827    @IFISA: Element    @IFISA: Element
1828    @ClsISA: te|ManakaiDOMElement    @ClsISA: te|ManakaiDOMElement
1829        
1830      @f:implements: AtomFeature10
1831    @s:elementType: AnyAtomElement||ManakaiDOM|all    @s:elementType: AnyAtomElement||ManakaiDOM|all
1832    
1833    @enDesc:    @enDesc:
# Line 1799  IFClsConstructDef: Line 1897  IFClsConstructDef:
1897    @IFISA: AtomElement    @IFISA: AtomElement
1898    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
1899    
1900      @f:implements: AtomFeature10
1901    @mv:refers: atomCommonAttributes    @mv:refers: atomCommonAttributes
1902    
1903    @cm:    @cm:
# Line 1940  IFClsConstructDef: Line 2039  IFClsConstructDef:
2039    @IFISA: AtomElement    @IFISA: AtomElement
2040    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
2041    
2042      @f:implements: AtomFeature10
2043    @mv:refers: atomCommonAttributes    @mv:refers: atomCommonAttributes
2044    
2045    @cm:    @cm:
# Line 2096  IFClsConstructDef: Line 2196  IFClsConstructDef:
2196    @IFISA: AtomElement    @IFISA: AtomElement
2197    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
2198    
2199      @f:implements: AtomFeature10
2200    @mv:refers: atomCommonAttributes    @mv:refers: atomCommonAttributes
2201    
2202    @cm:    @cm:
# Line 2203  IFClsETDef: Line 2304  IFClsETDef:
2304    @IFISA: AtomElement    @IFISA: AtomElement
2305    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
2306    
2307      @f:implements: AtomFeature10
2308    @mv:refers: atomCommonAttributes    @mv:refers: atomCommonAttributes
2309    
2310    @cm:    @cm:
# Line 2926  IFClsETDef: Line 3028  IFClsETDef:
3028    @IFISA: AtomElement    @IFISA: AtomElement
3029    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
3030    
3031      @f:implements: AtomFeature10
3032    @mv:refers: atomCommonAttributes    @mv:refers: atomCommonAttributes
3033    
3034    @cm:    @cm:
# Line 3459  IFClsETDef: Line 3562  IFClsETDef:
3562    @IFISA: AtomElement    @IFISA: AtomElement
3563    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
3564    
3565      @f:implements: AtomFeature10
3566    @mv:refers: atomCommonAttributes    @mv:refers: atomCommonAttributes
3567        
3568    @cm: atomUriCM    @cm: atomUriCM
# Line 3473  IFClsETDef: Line 3577  IFClsETDef:
3577    @IFISA: AtomElement    @IFISA: AtomElement
3578    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
3579    
3580      @f:implements: AtomFeature10
3581    @mv:refers: atomCommonAttributes    @mv:refers: atomCommonAttributes
3582    
3583    @cm: atomUriCM    @cm: atomUriCM
# Line 3487  IFClsETDef: Line 3592  IFClsETDef:
3592    @IFISA: AtomElement    @IFISA: AtomElement
3593    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
3594    
3595      @f:implements: AtomFeature10
3596    # no common attribs    # no common attribs
3597    @cm: TextCM    @cm: TextCM
3598    
# Line 3502  IFClsETDef: Line 3608  IFClsETDef:
3608    @IFISA: AtomElement    @IFISA: AtomElement
3609    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
3610    
3611      @f:implements: AtomFeature10
3612    # no common attribs    # no common attribs
3613    @cm: atomUriCM    @cm: atomUriCM
3614    
# Line 3517  IFClsETDef: Line 3624  IFClsETDef:
3624    @IFISA: AtomElement    @IFISA: AtomElement
3625    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
3626    
3627      @f:implements: AtomFeature10
3628    # no common attribs    # no common attribs
3629    @cm: atomEmailAddressCM    @cm: atomEmailAddressCM
3630    
# Line 3532  IFClsETDef: Line 3640  IFClsETDef:
3640    @IFISA: AtomElement    @IFISA: AtomElement
3641    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
3642    
3643      @f:implements: AtomFeature10
3644    @mv:refers: atomCommonAttributes    @mv:refers: atomCommonAttributes
3645    
3646    @cm: atomUriCM    @cm: atomUriCM
# Line 3546  IFClsETDef: Line 3655  IFClsETDef:
3655    @IFISA: AtomElement    @IFISA: AtomElement
3656    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
3657    
3658      @f:implements: AtomFeature10
3659    @mv:refers: atomCommonAttributes    @mv:refers: atomCommonAttributes
3660    
3661    @cm:    @cm:
# Line 3799  IFClsETDef: Line 3909  IFClsETDef:
3909    
3910    @IFISA: AtomPersonConstruct    @IFISA: AtomPersonConstruct
3911    @ClsISA: ManakaiAtomPersonConstruct    @ClsISA: ManakaiAtomPersonConstruct
3912    
3913      @f:implements: AtomFeature10
3914    @mv:refers: PersonAG    @mv:refers: PersonAG
3915    @mv:elementContentModel: PersonCM    @mv:elementContentModel: PersonCM
3916    
# Line 3816  IFClsETDef: Line 3928  IFClsETDef:
3928    @IFISA: AtomElement    @IFISA: AtomElement
3929    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
3930    
3931      @f:implements: AtomFeature10
3932    @mv:refers: atomCommonAttributes    @mv:refers: atomCommonAttributes
3933    
3934    @cm: undefinedContent    @cm: undefinedContent
# Line 3933  IFClsETDef: Line 4046  IFClsETDef:
4046    
4047    @IFISA: AtomPersonConstruct    @IFISA: AtomPersonConstruct
4048    @ClsISA: ManakaiAtomPersonConstruct    @ClsISA: ManakaiAtomPersonConstruct
4049    
4050      @f:implements: AtomFeature10
4051    @mv:refers: PersonAG    @mv:refers: PersonAG
4052    @mv:elementContentModel: PersonCM    @mv:elementContentModel: PersonCM
4053    
# Line 3951  IFClsETDef: Line 4066  IFClsETDef:
4066    @IFISA: AtomElement    @IFISA: AtomElement
4067    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
4068    
4069      @f:implements: AtomFeature10
4070    @mv:refers: atomCommonAttributes    @mv:refers: atomCommonAttributes
4071    
4072    @cm:    @cm:
# Line 4037  IFClsETDef: Line 4153  IFClsETDef:
4153    @IFISA: AtomElement    @IFISA: AtomElement
4154    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
4155    
4156      @f:implements: AtomFeature10
4157    @mv:refers: atomCommonAttributes    @mv:refers: atomCommonAttributes
4158    
4159    @cm: undefinedContent    @cm: undefinedContent
# Line 4172  IFClsETDef: Line 4289  IFClsETDef:
4289        of the <XA::type> attribute> of the node.        of the <XA::type> attribute> of the node.
4290      @@Type: DOMString      @@Type: DOMString
4291      @@Get:      @@Get:
4292          @@@enDesc:
4293            {P:: If the feature <Feature^^DISCore|QName::AtomThreadingFeature10>
4294                 is supported, the attribute getter <kwd:MUST> return
4295                 the string <CODE::application/atom+xml> when both of the
4296                 following conditions are met:
4297    
4298               - The attribute getter would otherwise return <DOM::null>.
4299    
4300               - The <A::AtomLinkElement.rel> attribute contains
4301                 a string value of <URI^^DISCore|QName::rel|replies>.
4302    
4303            }
4304        @@@nullCase:        @@@nullCase:
4305          @@@@enDesc:          @@@@enDesc:
4306            If the algorithm returns <DOM::null>.            If the algorithm returns <DOM::null>.
# Line 4183  IFClsETDef: Line 4312  IFClsETDef:
4312            $r => $r,            $r => $r,
4313            $defaultValue => {null},            $defaultValue => {null},
4314          }__;          }__;
4315    
4316            unless (defined $r) {
4317              __DEEP{
4318                my $rel = $self-><AG::AtomLinkElement.rel>;
4319                if (defined $rel and $rel eq <Q::rel|replies>) {
4320                  $r = q<application/atom+xml>;
4321                }
4322              }__;
4323            }
4324      @@Set:      @@Set:
4325        @@@nullCase:        @@@nullCase:
4326          @@@@enDesc:          @@@@enDesc:
# Line 4196  IFClsETDef: Line 4334  IFClsETDef:
4334            $given => $given,            $given => $given,
4335          }__;          }__;
4336    
4337        @@Test:
4338          @@@QName: AtomLinkElement.type.!rel.test
4339          @@@PerlDef:
4340            my $doc;
4341            __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
4342    
4343            my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'link');
4344    
4345            $test->id ('implied');
4346            my $type0 = $el-><AG::AtomLinkElement.type>;
4347            $test->assert_null ($type0);
4348    
4349            $test->id ('explicit');
4350            $el-><AS::AtomLinkElement.type> ('application/atom+xml');
4351            my $type1 = $el-><AG::AtomLinkElement.type>;
4352            $test->assert_equals ($type1, q<application/atom+xml>);
4353    
4354            $test->id ('different');
4355            $el-><AS::AtomLinkElement.type> ('application/xhtml+xml');
4356            my $type2 = $el-><AG::AtomLinkElement.type>;
4357            $test->assert_equals ($type2, q<application/xhtml+xml>);
4358        @@Test:
4359          @@@QName: AtomLinkElement.type.rel!=replies.test
4360          @@@PerlDef:
4361            my $doc;
4362            __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
4363    
4364            my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'link');
4365    
4366            $el-><AS::AtomLinkElement.rel> (<Q::rel|alternate>);
4367    
4368            $test->id ('implied');
4369            my $type0 = $el-><AG::AtomLinkElement.type>;
4370            $test->assert_null ($type0);
4371    
4372            $test->id ('explicit');
4373            $el-><AS::AtomLinkElement.type> ('application/atom+xml');
4374            my $type1 = $el-><AG::AtomLinkElement.type>;
4375            $test->assert_equals ($type1, q<application/atom+xml>);
4376    
4377            $test->id ('different');
4378            $el-><AS::AtomLinkElement.type> ('application/xhtml+xml');
4379            my $type2 = $el-><AG::AtomLinkElement.type>;
4380            $test->assert_equals ($type2, q<application/xhtml+xml>);
4381        @@Test:
4382          @@@QName: AtomLinkElement.type.rel=replies.test
4383          @@@PerlDef:
4384            my $doc;
4385            __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
4386    
4387            my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'link');
4388    
4389            $el-><AS::AtomLinkElement.rel> (<Q::rel|replies>);
4390    
4391            $test->id ('implied');
4392            my $type0 = $el-><AG::AtomLinkElement.type>;
4393            $test->assert_equals ($type0, q<application/atom+xml>);
4394    
4395            $test->id ('explicit');
4396            $el-><AS::AtomLinkElement.type> ('application/atom+xml');
4397            my $type1 = $el-><AG::AtomLinkElement.type>;
4398            $test->assert_equals ($type1, q<application/atom+xml>);
4399    
4400            $test->id ('different');
4401            $el-><AS::AtomLinkElement.type> ('application/xhtml+xml');
4402            my $type2 = $el-><AG::AtomLinkElement.type>;
4403            $test->assert_equals ($type2, q<application/xhtml+xml>);
4404    
4405    @ATTR:    @ATTR:
4406      @@Name: hreflang      @@Name: hreflang
4407      @@enDesc:      @@enDesc:
# Line 4304  IFClsETDef: Line 4510  IFClsETDef:
4510    
4511    @IFISA: AtomDateConstruct    @IFISA: AtomDateConstruct
4512    @ClsISA: ManakaiAtomDateConstruct    @ClsISA: ManakaiAtomDateConstruct
4513    
4514      @f:implements: AtomFeature10
4515    @mv:refers: DateAG    @mv:refers: DateAG
4516    @mv:elementContentModel: DateCM    @mv:elementContentModel: DateCM
4517    
# Line 4324  IFClsETDef: Line 4532  IFClsETDef:
4532    
4533    @IFISA: AtomTextConstruct    @IFISA: AtomTextConstruct
4534    @ClsISA: ManakaiAtomTextConstruct    @ClsISA: ManakaiAtomTextConstruct
4535    
4536      @f:implements: AtomFeature10
4537    @mv:refers: TextAG    @mv:refers: TextAG
4538    @mv:elementContentModel: TextCM    @mv:elementContentModel: TextCM
4539    
# Line 4359  IFClsETDef: Line 4569  IFClsETDef:
4569    @IFISA: AtomElement    @IFISA: AtomElement
4570    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
4571    
4572      @f:implements: AtomFeature10
4573    @mv:refers: atomCommonAttributes    @mv:refers: atomCommonAttributes
4574    
4575    @cm:    @cm:
# Line 4573  IFClsETDef: Line 4784  IFClsETDef:
4784    
4785    @IFISA: AtomTextConstruct    @IFISA: AtomTextConstruct
4786    @ClsISA: ManakaiAtomTextConstruct    @ClsISA: ManakaiAtomTextConstruct
4787    
4788      @f:implements: AtomFeature10
4789    @mv:refers: TextAG    @mv:refers: TextAG
4790    @mv:elementContentModel: TextCM    @mv:elementContentModel: TextCM
4791    
# Line 4589  IFClsETDef: Line 4802  IFClsETDef:
4802    
4803    @IFISA: AtomTextConstruct    @IFISA: AtomTextConstruct
4804    @ClsISA: ManakaiAtomTextConstruct    @ClsISA: ManakaiAtomTextConstruct
4805    
4806      @f:implements: AtomFeature10
4807    @mv:refers: TextAG    @mv:refers: TextAG
4808    @mv:elementContentModel: TextCM    @mv:elementContentModel: TextCM
4809    
# Line 4605  IFClsETDef: Line 4820  IFClsETDef:
4820    
4821    @IFISA: AtomTextConstruct    @IFISA: AtomTextConstruct
4822    @ClsISA: ManakaiAtomTextConstruct    @ClsISA: ManakaiAtomTextConstruct
4823    
4824      @f:implements: AtomFeature10
4825    @mv:refers: TextAG    @mv:refers: TextAG
4826    @mv:elementContentModel: TextCM    @mv:elementContentModel: TextCM
4827    
# Line 4621  IFClsETDef: Line 4838  IFClsETDef:
4838    
4839    @IFISA: AtomDateConstruct    @IFISA: AtomDateConstruct
4840    @ClsISA: ManakaiAtomDateConstruct    @ClsISA: ManakaiAtomDateConstruct
4841    
4842      @f:implements: AtomFeature10
4843    @mv:refers: DateAG    @mv:refers: DateAG
4844    @mv:elementContentModel: DateCM    @mv:elementContentModel: DateCM
4845    
# Line 4743  ResourceDef: Line 4962  ResourceDef:
4962    @cm: dxm|ANY||ManakaiDOM|all    @cm: dxm|ANY||ManakaiDOM|all
4963    @enImplNote:    @enImplNote:
4964      (text | anyForeignElement)*      (text | anyForeignElement)*
4965    
4966    ## -- Atom Threading Extension [RFC 4685]
4967    
4968    IFClsDef:
4969      @IFQName: AtomEntryElementThread
4970      @ClsQName: ManakaiAtomEntryElementThread
4971    
4972      @ClsISA: ManakaiAtomEntryElement
4973    
4974      @f:implements: AtomThreadingFeature10
4975    
4976      @enDesc:
4977        If the feature <Feature^^DISCore|QName::AtomThreadingFeature10>
4978        is supported, any <IF::Element> whose element type
4979        is <XE::atom|entry> <kwd:MUST> implement the <IF::AtomEntryElementThread>
4980        interface in addition to other appropriate interfaces.
4981    
4982      @Test:
4983        @@QName: AtomEntryElementThread.1.test
4984        @@PerlDef:
4985          my $doc;
4986          __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
4987    
4988          my $el = $doc->create_element_ns (<Q::atom|>, 'entry');
4989    
4990          $test->id ('interface');
4991          $test->assert_isa ($el, <IFName::AtomEntryElementThread>);
4992    
4993          $test->id ('feature');
4994          $test->assert_true ($el->is_supported (<Q::fe|AtomThreading> => '1.0'));
4995    
4996      @Attr:
4997        @@Name: threadInReplyToElements
4998        @@enDesc:
4999          A static list of <XE::thr|in-reply-to> child elements of the node.
5000        @@Type: StaticNodeList
5001        @@Get:
5002          @@@enDesc:
5003            It <kwd:MUST> <I::return a <XE::thr|in-reply-to> child element list>
5004            of the node.
5005          @@@PerlDef:
5006            __CODE{returnChildElementList::
5007              $node => $self,
5008              $namespaceURI => {<Q::thr|>},
5009              $localName => 'in-reply-to',
5010              $r => $r,
5011            }__;
5012    ##AtomEntryElementThread
5013    
5014    IFClsETDef:
5015      @IFQName: AtomThreadInReplyToElement
5016      @ETQName: thr|in-reply-to
5017      @ETRQName: thr|in-reply-to
5018      @ClsQName: ManakaiAtomThreadInReplyToElement
5019    
5020      @IFISA: AtomDateConstruct
5021      @ClsISA: ManakaiAtomDateConstruct
5022    
5023      @f:implements: AtomThreadingFeature10
5024      @mv:refers: atomCommonAttributes
5025    
5026      @cm: undefinedContent
5027    
5028      @enDesc:
5029        The <XE::thr|in-reply-to> element is used to indicate
5030        that an entry is a response to another resource.
5031    
5032        If the entry is a response to multiple resources,
5033        additional <XE::thr|in-reply-to> element <kwd:MAY>
5034        be used.
5035    
5036        RFC 4685 assigns no significance to the order in which
5037        multiple <XE::thr|in-reply-to> element appear within
5038        an entry.
5039    
5040      @Test:
5041        @@QName: AtomThreadInReplyToElement.1.test
5042        @@PerlDef:
5043          my $doc;
5044          __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
5045    
5046          my $el = $doc->create_element_ns (<Q::thr|>, 'in-reply-to');
5047    
5048          $test->id ('interface');
5049          $test->assert_isa ($el, <IFName::AtomThreadInReplyToElement>);
5050    
5051          $test->id ('feature');
5052          $test->assert_true ($el->is_supported (<Q::fe|AtomThreading> => '1.0'));
5053    
5054      @ATTR:
5055        @@Name: ref
5056        @@enDesc:
5057          The <XA::ref> attribute of the element.
5058    
5059          It <kwd:MUST> <I::reflect the URI value
5060          of the <XA::ref> attribute> of the node.
5061    
5062          The <XA::ref> attribute specifies the persistent,
5063          universally unique identifier of the resource being
5064          responded to.  The value <kwd:MUST> conform to
5065          the same construction and comparison rules as the
5066          value of the <XE::atom|id> element.  Though the IRI
5067          might use a dereferenceable scheme, processors <kwd:MUST-NOT>
5068          assume that it can be dereferenced.
5069    
5070          The <XE::thr|in-reply-to> element <kwd:MUST> contain
5071          a <XA::ref> attribute identifying the resource that
5072          is being respnoded to.
5073    
5074          If the resource being responded to does not have a persistent,
5075          universally unique identifier, the publisher <kwd:MUST> assign an
5076          identifier that satisfies all the considerations in Section 4.2.6 of
5077          RFC 4287 for use as the value of the <XA::ref> attribute.
5078          In that case, if a representation of the resource can be retrieved
5079          from an IRI that can be used as a valid atom:id value, then this IRI
5080          <kwd:SHOULD> be used as the value of both the <XA::ref> and
5081          <XA::href> attributes.
5082        @@Type: DOMString
5083        @@actualType: DOMURI
5084        @@Get:
5085          @@@nullCase:
5086            @@@@enDesc:
5087              If the algorithm returns <DOM::null>.
5088          @@@PerlDef:
5089            __CODE{getReflectAttrURIValue::
5090              $node => $self,
5091              $namespaceURI => {null},
5092              $localName => 'ref',
5093              $r => $r,
5094              $defaultValue => {null},
5095            }__;
5096        @@Set:
5097          @@@nullCase:
5098            @@@@enDesc:
5099              Removes the attribute.
5100          @@@NodeReadOnlyError:
5101          @@@PerlDef:
5102            __CODE{setReflectAttrURIValue::
5103              $node => $self,
5104              $namespaceURI => {null},
5105              $localName => 'ref',
5106              $given => $given,
5107            }__;
5108            
5109      @ATTR:
5110        @@Name: source
5111        @@enDesc:
5112          The <XA::source> attribute of the element.
5113    
5114          It <kwd:MUST> <I::reflect the URI value
5115          of the <XA::source> attribute> of the node.
5116    
5117          The <XA::source> attribute <kwd:MAY> be used to specify the IRI
5118          of an Atom Feed or Entry Document containing an
5119          <XE::atom|entry> with an <XE::atom|id> value equal to the
5120          value of the <XA::ref> attribute.  The IRI specified <kwd:MUST>
5121          be dereferenceable.
5122        @@Type: DOMString
5123        @@actualType: DOMURI
5124        @@Get:
5125          @@@nullCase:
5126            @@@@enDesc:
5127              If the algorithm returns <DOM::null>.
5128          @@@PerlDef:
5129            __CODE{getReflectAttrURIValue::
5130              $node => $self,
5131              $namespaceURI => {null},
5132              $localName => 'source',
5133              $r => $r,
5134              $defaultValue => {null},
5135            }__;
5136        @@Set:
5137          @@@nullCase:
5138            @@@@enDesc:
5139              Removes the attribute.
5140          @@@NodeReadOnlyError:
5141          @@@PerlDef:
5142            __CODE{setReflectAttrURIValue::
5143              $node => $self,
5144              $namespaceURI => {null},
5145              $localName => 'source',
5146              $given => $given,
5147            }__;
5148            
5149      @ATTR:
5150        @@Name: href
5151        @@enDesc:
5152          The <XA::href> attribute of the element.
5153    
5154          It <kwd:MUST> <I::reflect the URI value
5155          of the <XA::href> attribute> of the node.
5156    
5157          The <XA::href> attribute specifies an IRI that may be used
5158          to retrieve a representation of the resource being
5159          responded to.  The IRI specified <kwd:MUST> be
5160          dereferenceable.
5161        @@Type: DOMString
5162        @@actualType: DOMURI
5163        @@Get:
5164          @@@nullCase:
5165            @@@@enDesc:
5166              If the algorithm returns <DOM::null>.
5167          @@@PerlDef:
5168            __CODE{getReflectAttrURIValue::
5169              $node => $self,
5170              $namespaceURI => {null},
5171              $localName => 'href',
5172              $r => $r,
5173              $defaultValue => {null},
5174            }__;
5175        @@Set:
5176          @@@nullCase:
5177            @@@@enDesc:
5178              Removes the attribute.
5179          @@@NodeReadOnlyError:
5180          @@@PerlDef:
5181            __CODE{setReflectAttrURIValue::
5182              $node => $self,
5183              $namespaceURI => {null},
5184              $localName => 'href',
5185              $given => $given,
5186            }__;
5187      
5188      @ATTR:
5189        @@Name: type
5190        @@enDesc:
5191          The <XA::type> attribute of the element.
5192    
5193          It <kwd:MUST> <I::reflect the string value
5194          of the <XA::type> attribute> of the node.
5195    
5196          The <XA::type> attribute <kwd:MAY> be used to provide
5197          a hint to the client about the media type of the
5198          resource identified by the <XA::href> attribute.
5199          The <XA::type> attribute is only meaningful if a
5200          corresponding <XA::href> attribute is also provided.
5201        @@Type: DOMString
5202        @@Get:
5203          @@@nullCase:
5204            @@@@enDesc:
5205              If the algorithm returns <DOM::null>.
5206          @@@PerlDef:
5207            __CODE{getReflectAttrStringValue::
5208              $node => $self,
5209              $namespaceURI => {null},
5210              $localName => 'type',
5211              $r => $r,
5212              $defaultValue => {null},
5213            }__;
5214        @@Set:
5215          @@@nullCase:
5216            @@@@enDesc:
5217              Removes the attribute.
5218          @@@NodeReadOnlyError:
5219          @@@PerlDef:
5220            __CODE{setReflectAttrStringValue::
5221              $node => $self,
5222              $namespaceURI => {null},
5223              $localName => 'type',
5224              $given => $given,
5225            }__;
5226    ##AtomThreadInReplyToElement
5227    
5228    IFClsDef:
5229      @IFQName: AtomLinkElementThread
5230      @ClsQName: ManakaiAtomLinkElementThread
5231    
5232      @ClsISA: ManakaiAtomLinkElement
5233    
5234      @f:implements: AtomThreadingFeature10
5235    
5236      @enDesc:
5237        An <XE::atom|link> element with a <XA::rel> attribute value of
5238        <XML::replies> may be used to reference a resource where responses
5239        to an entry may be found.  If the <XA::type> attribute of the
5240        <XE::atom|link> is omitted, its value is assumed to be
5241        <XML::application/atom+xml>.
5242    
5243        A <XML::replies> link appearing as a child of the <XE::atom|feed>
5244        or <XE::atom|source> element indicates that the referenced
5245        resource likely contains responses to any of that
5246        feed's entries.  A <XML::replies>
5247        link appearing as a child of an <XE::atom|entry> element
5248        indicates that the linked resource likely contains responses
5249        specific to that entry.
5250    
5251        If the feature <Feature^^DISCore|QName::AtomThreadingFeature10>
5252        is supported, any <IF::Element> whose element type
5253        is <XE::atom|link> <kwd:MUST> implement the <IF::AtomLinkElementThread>
5254        interface in addition to other appropriate interfaces.
5255    
5256      @Test:
5257        @@QName: AtomLinkElementThread.1.test
5258        @@PerlDef:
5259          my $doc;
5260          __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
5261    
5262          my $el = $doc->create_element_ns (<Q::atom|>, 'link');
5263    
5264          $test->id ('interface');
5265          $test->assert_isa ($el, <IFName::AtomLinkElementThread>);
5266    
5267          $test->id ('feature');
5268          $test->assert_true ($el->is_supported (<Q::fe|AtomThreading> => '1.0'));
5269    
5270      @ATTR:
5271        @@Name: threadCount
5272        @@enDesc:
5273          The <XA::thr|count> attribute of the element.
5274    
5275          It <kwd:MUST> <I::reflect the non-negative integer value
5276          of the <XA::thr|count> attribute> of the node.
5277    
5278          An <XE::atom|link> element using the <XML::replies>
5279          <XA::rel> attribute value <kwd:MAY> contain
5280          a <XA::thr|count> attribute whose value is a
5281          non-negative integer that provides a hint to clients
5282          as to the total number of replies contained by the
5283          linked resource.  The value is advisory and
5284          may not accurately reflect the actual number of replies.
5285        @@Type: idl|long||ManakaiDOM|all
5286        @@Get:
5287          @@@PerlDef:
5288            __CODE{getReflectAttrNonNegativeIntegerValue::
5289              $node => $self,
5290              $namespaceURI => {<Q::thr|>},
5291              $localName => 'count',
5292              $r => $r,
5293              $defaultValue => {null},
5294            }__;
5295        @@Set:
5296          @@@NodeReadOnlyError:
5297          @@@PerlDef:
5298            __CODE{setReflectAttrNonNegativeIntegerValue::
5299              $node => $self,
5300              $namespaceURI => {<Q::thr|>},
5301              $localName => 'count',
5302              $given => $given,
5303            }__;
5304    
5305        @@Test:
5306          @@@QName: AtomLinkElementThread.threadCount.1.test
5307          @@@PerlDef:
5308            my $doc;
5309            __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
5310    
5311            my $link = $doc->create_element_ns (<Q::atom|>, 'link');
5312    
5313            $test->id ('default');
5314            $test->assert_num_equals
5315                     (expected_value => -1,
5316                      actual_value =>
5317                        $link-><AG::AtomLinkElementThread.threadCount>);
5318    
5319            $test->id ('zero');
5320            $link-><AS::AtomLinkElementThread.threadCount> (0);
5321            $test->assert_num_equals
5322                     (expected_value => 0,
5323                      actual_value =>
5324                        $link-><AG::AtomLinkElementThread.threadCount>);
5325            $test->id ('zero.attr');
5326            $test->assert_equals ($link->get_attribute_ns (<Q::thr|>, 'count'), '0');
5327    
5328            $test->id ('one');
5329            $link-><AS::AtomLinkElementThread.threadCount> (1);
5330            $test->assert_num_equals
5331                     (expected_value => 1,
5332                      actual_value =>
5333                        $link-><AG::AtomLinkElementThread.threadCount>);
5334            $test->id ('one.attr');
5335            $test->assert_equals ($link->get_attribute_ns (<Q::thr|>, 'count'), '1');
5336    
5337            $test->id ('10000');
5338            $link-><AS::AtomLinkElementThread.threadCount> (10000);
5339            $test->assert_num_equals
5340                     (expected_value => 10000,
5341                      actual_value =>
5342                        $link-><AG::AtomLinkElementThread.threadCount>);
5343            $test->id ('10000.attr');
5344            $test->assert_equals ($link->get_attribute_ns (<Q::thr|>, 'count'),
5345                                  '10000');
5346    
5347            $test->id ('+10000');
5348            $link->set_attribute_ns (<Q::thr|>, 'thr:count', '+10000');
5349            $test->assert_num_equals
5350                     (expected_value => 10000,
5351                      actual_value =>
5352                        $link-><AG::AtomLinkElementThread.threadCount>);
5353    
5354            $test->id ('010000');
5355            $link->set_attribute_ns (<Q::thr|>, 'thr:count', '010000');
5356            $test->assert_num_equals
5357                     (expected_value => 10000,
5358                      actual_value =>
5359                        $link-><AG::AtomLinkElementThread.threadCount>);
5360    
5361            $test->id ('-100');
5362            $link-><AS::AtomLinkElementThread.threadCount> (-100);
5363            $test->assert_num_equals
5364                     (expected_value => -1,
5365                      actual_value =>
5366                        $link-><AG::AtomLinkElementThread.threadCount>);
5367            $test->id ('-100.attr');
5368            $test->assert_false ($link->has_attribute_ns (<Q::thr|>, 'count'));
5369    
5370            $test->id ('120a');
5371            $link->set_attribute_ns (<Q::thr|>, 'thr:count', '120a');
5372            $test->assert_num_equals
5373                     (expected_value => -1,
5374                      actual_value =>
5375                        $link-><AG::AtomLinkElementThread.threadCount>);
5376    
5377            $test->id ('-1');
5378            $link-><AS::AtomLinkElementThread.threadCount> (-1);
5379            $test->assert_num_equals
5380                     (expected_value => -1,
5381                      actual_value =>
5382                        $link-><AG::AtomLinkElementThread.threadCount>);
5383            $test->id ('-1.attr');
5384            $test->assert_false ($link->has_attribute_ns (<Q::thr|>, 'count'));
5385    
5386      @enImplNote:
5387        @@ddid: updated
5388        @@@:
5389          {TODO::
5390            <XA::thr|updated> attribute
5391          }
5392    ##AtomLinkElementThread
5393    
5394    enImplNote:
5395      @@ddid: total
5396      @@@:
5397        {TODO::
5398          <XE::thr|total>
5399        }
5400    
5401    enImplNote:
5402      @@ddid: threaddtd
5403      @@@:
5404        {TODO::
5405          DTD impl for threading
5406        }

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.17

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24