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

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

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24