/[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.14 by wakaba, Tue Oct 3 09:37:36 2006 UTC
# Line 119  Namespace: Line 119  Namespace:
119      http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/Element/      http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/Element/
120    @test:    @test:
121      http://suika.fam.cx/~wakaba/archive/2004/dis/Test#      http://suika.fam.cx/~wakaba/archive/2004/dis/Test#
122      @thr:
123        http://purl.org/syndication/thread/1.0
124    @tx:    @tx:
125      http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/XML/      http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/XML/
126    @urigen:    @urigen:
# Line 270  ElementTypeBinding: Line 272  ElementTypeBinding:
272        @@@@: s|ElementType        @@@@: s|ElementType
273        @@@ForCheck: s|ForML        @@@ForCheck: s|ForML
274    
     @@f:implements: AtomFeature10  
   
275  ElementTypeBinding:  ElementTypeBinding:
276    @Name: IFClsDef    @Name: IFClsDef
277    @ElementType:    @ElementType:
# Line 300  ElementTypeBinding: Line 300  ElementTypeBinding:
300        @@@ContentType: DISCore|TFPQNames        @@@ContentType: DISCore|TFPQNames
301        @@@ForCheck: ManakaiDOM|ForClass ManakaiDOM|ManakaiDOMLatest        @@@ForCheck: ManakaiDOM|ForClass ManakaiDOM|ManakaiDOMLatest
302    
     @@f:implements: AtomFeature10  
   
303  ElementTypeBinding:  ElementTypeBinding:
304    @Name: IFClsConstructDef    @Name: IFClsConstructDef
305    @ElementType:    @ElementType:
# Line 341  ElementTypeBinding: Line 339  ElementTypeBinding:
339        @@@@: mv|ElementContentModel        @@@@: mv|ElementContentModel
340        @@@ForCheck: mv|ForCM        @@@ForCheck: mv|ForCM
341    
     @@f:implements: AtomFeature10  
342    
343  ElementTypeBinding:  ElementTypeBinding:
344    @Name: IFQName    @Name: IFQName
# Line 568  FeatureDef: Line 565  FeatureDef:
565      @@enDesc:      @@enDesc:
566        The Atom DOM, version 1.0.        The Atom DOM, version 1.0.
567    
568    FeatureDef:
569      @featureQName: fe|AtomThreading
570      @QName: AtomThreadingFeature
571      @FeatureVerDef:
572        @@QName: AtomThreadingFeature10
573        @@Version: 1.0
574        @@f:instanceOf: AtomThreadingFeature
575        @@f:requires: fe|AtomFeature10
576        @@enDesc:
577          The Atom Threading Extension DOM, version 1.0.
578    
579  ## -- Modules  ## -- Modules
580    
581  ModuleSetDef:  ModuleSetDef:
# Line 708  IFClsDef: Line 716  IFClsDef:
716      methods to create Atom documents.      methods to create Atom documents.
717    
718    @f:provides: AtomFeature10    @f:provides: AtomFeature10
719      @f:implements: AtomFeature10
720    
721    @Test:    @Test:
722      @@QName: AtomImplementation.interface.test      @@QName: AtomImplementation.interface.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:
# Line 1521  IFClsDef: Line 1622  IFClsDef:
1622    @IFISA: Document    @IFISA: Document
1623    @ClsISA: td|ManakaiDOMDocument    @ClsISA: td|ManakaiDOMDocument
1624    
1625      @f:implements: AtomFeature10
1626    @s:rootElementType: AnyAtomElement||ManakaiDOM|all    @s:rootElementType: AnyAtomElement||ManakaiDOM|all
1627    
1628    @enDesc:    @enDesc:
# Line 1552  IFClsDef: Line 1654  IFClsDef:
1654    @IFISA: AtomDocument    @IFISA: AtomDocument
1655    @ClsISA: ManakaiAtomDocument    @ClsISA: ManakaiAtomDocument
1656    
1657      @f:implements: AtomFeature10
1658    @s:rootElementType:    @s:rootElementType:
1659      @@@: atom|feed      @@@: atom|feed
1660      @@DISCore:stopISARecursive: 1      @@DISCore:stopISARecursive: 1
# Line 1589  IFClsDef: Line 1692  IFClsDef:
1692    @IFISA: AtomDocument    @IFISA: AtomDocument
1693    @ClsISA: ManakaiAtomDocument    @ClsISA: ManakaiAtomDocument
1694    
1695      @f:implements: AtomFeature10
1696    @s:rootElementType:    @s:rootElementType:
1697      @@@: atom|entry      @@@: atom|entry
1698      @@DISCore:stopISARecursive: 1      @@DISCore:stopISARecursive: 1
# Line 1730  IFClsDef: Line 1834  IFClsDef:
1834    @IFISA: Element    @IFISA: Element
1835    @ClsISA: te|ManakaiDOMElement    @ClsISA: te|ManakaiDOMElement
1836        
1837      @f:implements: AtomFeature10
1838    @s:elementType: AnyAtomElement||ManakaiDOM|all    @s:elementType: AnyAtomElement||ManakaiDOM|all
1839    
1840    @enDesc:    @enDesc:
# Line 1799  IFClsConstructDef: Line 1904  IFClsConstructDef:
1904    @IFISA: AtomElement    @IFISA: AtomElement
1905    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
1906    
1907      @f:implements: AtomFeature10
1908    @mv:refers: atomCommonAttributes    @mv:refers: atomCommonAttributes
1909    
1910    @cm:    @cm:
# Line 1940  IFClsConstructDef: Line 2046  IFClsConstructDef:
2046    @IFISA: AtomElement    @IFISA: AtomElement
2047    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
2048    
2049      @f:implements: AtomFeature10
2050    @mv:refers: atomCommonAttributes    @mv:refers: atomCommonAttributes
2051    
2052    @cm:    @cm:
# Line 2096  IFClsConstructDef: Line 2203  IFClsConstructDef:
2203    @IFISA: AtomElement    @IFISA: AtomElement
2204    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
2205    
2206      @f:implements: AtomFeature10
2207    @mv:refers: atomCommonAttributes    @mv:refers: atomCommonAttributes
2208    
2209    @cm:    @cm:
# Line 2203  IFClsETDef: Line 2311  IFClsETDef:
2311    @IFISA: AtomElement    @IFISA: AtomElement
2312    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
2313    
2314      @f:implements: AtomFeature10
2315    @mv:refers: atomCommonAttributes    @mv:refers: atomCommonAttributes
2316    
2317    @cm:    @cm:
# Line 2926  IFClsETDef: Line 3035  IFClsETDef:
3035    @IFISA: AtomElement    @IFISA: AtomElement
3036    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
3037    
3038      @f:implements: AtomFeature10
3039    @mv:refers: atomCommonAttributes    @mv:refers: atomCommonAttributes
3040    
3041    @cm:    @cm:
# Line 3459  IFClsETDef: Line 3569  IFClsETDef:
3569    @IFISA: AtomElement    @IFISA: AtomElement
3570    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
3571    
3572      @f:implements: AtomFeature10
3573    @mv:refers: atomCommonAttributes    @mv:refers: atomCommonAttributes
3574        
3575    @cm: atomUriCM    @cm: atomUriCM
# Line 3473  IFClsETDef: Line 3584  IFClsETDef:
3584    @IFISA: AtomElement    @IFISA: AtomElement
3585    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
3586    
3587      @f:implements: AtomFeature10
3588    @mv:refers: atomCommonAttributes    @mv:refers: atomCommonAttributes
3589    
3590    @cm: atomUriCM    @cm: atomUriCM
# Line 3487  IFClsETDef: Line 3599  IFClsETDef:
3599    @IFISA: AtomElement    @IFISA: AtomElement
3600    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
3601    
3602      @f:implements: AtomFeature10
3603    # no common attribs    # no common attribs
3604    @cm: TextCM    @cm: TextCM
3605    
# Line 3502  IFClsETDef: Line 3615  IFClsETDef:
3615    @IFISA: AtomElement    @IFISA: AtomElement
3616    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
3617    
3618      @f:implements: AtomFeature10
3619    # no common attribs    # no common attribs
3620    @cm: atomUriCM    @cm: atomUriCM
3621    
# Line 3517  IFClsETDef: Line 3631  IFClsETDef:
3631    @IFISA: AtomElement    @IFISA: AtomElement
3632    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
3633    
3634      @f:implements: AtomFeature10
3635    # no common attribs    # no common attribs
3636    @cm: atomEmailAddressCM    @cm: atomEmailAddressCM
3637    
# Line 3532  IFClsETDef: Line 3647  IFClsETDef:
3647    @IFISA: AtomElement    @IFISA: AtomElement
3648    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
3649    
3650      @f:implements: AtomFeature10
3651    @mv:refers: atomCommonAttributes    @mv:refers: atomCommonAttributes
3652    
3653    @cm: atomUriCM    @cm: atomUriCM
# Line 3546  IFClsETDef: Line 3662  IFClsETDef:
3662    @IFISA: AtomElement    @IFISA: AtomElement
3663    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
3664    
3665      @f:implements: AtomFeature10
3666    @mv:refers: atomCommonAttributes    @mv:refers: atomCommonAttributes
3667    
3668    @cm:    @cm:
# Line 3799  IFClsETDef: Line 3916  IFClsETDef:
3916    
3917    @IFISA: AtomPersonConstruct    @IFISA: AtomPersonConstruct
3918    @ClsISA: ManakaiAtomPersonConstruct    @ClsISA: ManakaiAtomPersonConstruct
3919    
3920      @f:implements: AtomFeature10
3921    @mv:refers: PersonAG    @mv:refers: PersonAG
3922    @mv:elementContentModel: PersonCM    @mv:elementContentModel: PersonCM
3923    
# Line 3816  IFClsETDef: Line 3935  IFClsETDef:
3935    @IFISA: AtomElement    @IFISA: AtomElement
3936    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
3937    
3938      @f:implements: AtomFeature10
3939    @mv:refers: atomCommonAttributes    @mv:refers: atomCommonAttributes
3940    
3941    @cm: undefinedContent    @cm: undefinedContent
# Line 3933  IFClsETDef: Line 4053  IFClsETDef:
4053    
4054    @IFISA: AtomPersonConstruct    @IFISA: AtomPersonConstruct
4055    @ClsISA: ManakaiAtomPersonConstruct    @ClsISA: ManakaiAtomPersonConstruct
4056    
4057      @f:implements: AtomFeature10
4058    @mv:refers: PersonAG    @mv:refers: PersonAG
4059    @mv:elementContentModel: PersonCM    @mv:elementContentModel: PersonCM
4060    
# Line 3951  IFClsETDef: Line 4073  IFClsETDef:
4073    @IFISA: AtomElement    @IFISA: AtomElement
4074    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
4075    
4076      @f:implements: AtomFeature10
4077    @mv:refers: atomCommonAttributes    @mv:refers: atomCommonAttributes
4078    
4079    @cm:    @cm:
# Line 4037  IFClsETDef: Line 4160  IFClsETDef:
4160    @IFISA: AtomElement    @IFISA: AtomElement
4161    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
4162    
4163      @f:implements: AtomFeature10
4164    @mv:refers: atomCommonAttributes    @mv:refers: atomCommonAttributes
4165    
4166    @cm: undefinedContent    @cm: undefinedContent
# Line 4172  IFClsETDef: Line 4296  IFClsETDef:
4296        of the <XA::type> attribute> of the node.        of the <XA::type> attribute> of the node.
4297      @@Type: DOMString      @@Type: DOMString
4298      @@Get:      @@Get:
4299          @@@enDesc:
4300            {P:: If the feature <Feature^^DISCore|QName::AtomThreadingFeature10>
4301                 is supported, the attribute getter <kwd:MUST> return
4302                 the string <CODE::application/atom+xml> when both of the
4303                 following conditions are met:
4304    
4305               - The attribute getter would otherwise return <DOM::null>.
4306    
4307               - The <A::AtomLinkElement.rel> attribute contains
4308                 a string value of <URI^^DISCore|QName::rel|replies>.
4309    
4310            }
4311        @@@nullCase:        @@@nullCase:
4312          @@@@enDesc:          @@@@enDesc:
4313            If the algorithm returns <DOM::null>.            If the algorithm returns <DOM::null>.
# Line 4183  IFClsETDef: Line 4319  IFClsETDef:
4319            $r => $r,            $r => $r,
4320            $defaultValue => {null},            $defaultValue => {null},
4321          }__;          }__;
4322    
4323            unless (defined $r) {
4324              __DEEP{
4325                my $rel = $self-><AG::AtomLinkElement.rel>;
4326                if (defined $rel and $rel eq <Q::rel|replies>) {
4327                  $r = q<application/atom+xml>;
4328                }
4329              }__;
4330            }
4331      @@Set:      @@Set:
4332        @@@nullCase:        @@@nullCase:
4333          @@@@enDesc:          @@@@enDesc:
# Line 4196  IFClsETDef: Line 4341  IFClsETDef:
4341            $given => $given,            $given => $given,
4342          }__;          }__;
4343    
4344        @@Test:
4345          @@@QName: AtomLinkElement.type.!rel.test
4346          @@@PerlDef:
4347            my $doc;
4348            __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
4349    
4350            my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'link');
4351    
4352            $test->id ('implied');
4353            my $type0 = $el-><AG::AtomLinkElement.type>;
4354            $test->assert_null ($type0);
4355    
4356            $test->id ('explicit');
4357            $el-><AS::AtomLinkElement.type> ('application/atom+xml');
4358            my $type1 = $el-><AG::AtomLinkElement.type>;
4359            $test->assert_equals ($type1, q<application/atom+xml>);
4360    
4361            $test->id ('different');
4362            $el-><AS::AtomLinkElement.type> ('application/xhtml+xml');
4363            my $type2 = $el-><AG::AtomLinkElement.type>;
4364            $test->assert_equals ($type2, q<application/xhtml+xml>);
4365        @@Test:
4366          @@@QName: AtomLinkElement.type.rel!=replies.test
4367          @@@PerlDef:
4368            my $doc;
4369            __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
4370    
4371            my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'link');
4372    
4373            $el-><AS::AtomLinkElement.rel> (<Q::rel|alternate>);
4374    
4375            $test->id ('implied');
4376            my $type0 = $el-><AG::AtomLinkElement.type>;
4377            $test->assert_null ($type0);
4378    
4379            $test->id ('explicit');
4380            $el-><AS::AtomLinkElement.type> ('application/atom+xml');
4381            my $type1 = $el-><AG::AtomLinkElement.type>;
4382            $test->assert_equals ($type1, q<application/atom+xml>);
4383    
4384            $test->id ('different');
4385            $el-><AS::AtomLinkElement.type> ('application/xhtml+xml');
4386            my $type2 = $el-><AG::AtomLinkElement.type>;
4387            $test->assert_equals ($type2, q<application/xhtml+xml>);
4388        @@Test:
4389          @@@QName: AtomLinkElement.type.rel=replies.test
4390          @@@PerlDef:
4391            my $doc;
4392            __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
4393    
4394            my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'link');
4395    
4396            $el-><AS::AtomLinkElement.rel> (<Q::rel|replies>);
4397    
4398            $test->id ('implied');
4399            my $type0 = $el-><AG::AtomLinkElement.type>;
4400            $test->assert_equals ($type0, q<application/atom+xml>);
4401    
4402            $test->id ('explicit');
4403            $el-><AS::AtomLinkElement.type> ('application/atom+xml');
4404            my $type1 = $el-><AG::AtomLinkElement.type>;
4405            $test->assert_equals ($type1, q<application/atom+xml>);
4406    
4407            $test->id ('different');
4408            $el-><AS::AtomLinkElement.type> ('application/xhtml+xml');
4409            my $type2 = $el-><AG::AtomLinkElement.type>;
4410            $test->assert_equals ($type2, q<application/xhtml+xml>);
4411    
4412    @ATTR:    @ATTR:
4413      @@Name: hreflang      @@Name: hreflang
4414      @@enDesc:      @@enDesc:
# Line 4304  IFClsETDef: Line 4517  IFClsETDef:
4517    
4518    @IFISA: AtomDateConstruct    @IFISA: AtomDateConstruct
4519    @ClsISA: ManakaiAtomDateConstruct    @ClsISA: ManakaiAtomDateConstruct
4520    
4521      @f:implements: AtomFeature10
4522    @mv:refers: DateAG    @mv:refers: DateAG
4523    @mv:elementContentModel: DateCM    @mv:elementContentModel: DateCM
4524    
# Line 4324  IFClsETDef: Line 4539  IFClsETDef:
4539    
4540    @IFISA: AtomTextConstruct    @IFISA: AtomTextConstruct
4541    @ClsISA: ManakaiAtomTextConstruct    @ClsISA: ManakaiAtomTextConstruct
4542    
4543      @f:implements: AtomFeature10
4544    @mv:refers: TextAG    @mv:refers: TextAG
4545    @mv:elementContentModel: TextCM    @mv:elementContentModel: TextCM
4546    
# Line 4359  IFClsETDef: Line 4576  IFClsETDef:
4576    @IFISA: AtomElement    @IFISA: AtomElement
4577    @ClsISA: ManakaiAtomElement    @ClsISA: ManakaiAtomElement
4578    
4579      @f:implements: AtomFeature10
4580    @mv:refers: atomCommonAttributes    @mv:refers: atomCommonAttributes
4581    
4582    @cm:    @cm:
# Line 4573  IFClsETDef: Line 4791  IFClsETDef:
4791    
4792    @IFISA: AtomTextConstruct    @IFISA: AtomTextConstruct
4793    @ClsISA: ManakaiAtomTextConstruct    @ClsISA: ManakaiAtomTextConstruct
4794    
4795      @f:implements: AtomFeature10
4796    @mv:refers: TextAG    @mv:refers: TextAG
4797    @mv:elementContentModel: TextCM    @mv:elementContentModel: TextCM
4798    
# Line 4589  IFClsETDef: Line 4809  IFClsETDef:
4809    
4810    @IFISA: AtomTextConstruct    @IFISA: AtomTextConstruct
4811    @ClsISA: ManakaiAtomTextConstruct    @ClsISA: ManakaiAtomTextConstruct
4812    
4813      @f:implements: AtomFeature10
4814    @mv:refers: TextAG    @mv:refers: TextAG
4815    @mv:elementContentModel: TextCM    @mv:elementContentModel: TextCM
4816    
# Line 4605  IFClsETDef: Line 4827  IFClsETDef:
4827    
4828    @IFISA: AtomTextConstruct    @IFISA: AtomTextConstruct
4829    @ClsISA: ManakaiAtomTextConstruct    @ClsISA: ManakaiAtomTextConstruct
4830    
4831      @f:implements: AtomFeature10
4832    @mv:refers: TextAG    @mv:refers: TextAG
4833    @mv:elementContentModel: TextCM    @mv:elementContentModel: TextCM
4834    
# Line 4621  IFClsETDef: Line 4845  IFClsETDef:
4845    
4846    @IFISA: AtomDateConstruct    @IFISA: AtomDateConstruct
4847    @ClsISA: ManakaiAtomDateConstruct    @ClsISA: ManakaiAtomDateConstruct
4848    
4849      @f:implements: AtomFeature10
4850    @mv:refers: DateAG    @mv:refers: DateAG
4851    @mv:elementContentModel: DateCM    @mv:elementContentModel: DateCM
4852    
# Line 4743  ResourceDef: Line 4969  ResourceDef:
4969    @cm: dxm|ANY||ManakaiDOM|all    @cm: dxm|ANY||ManakaiDOM|all
4970    @enImplNote:    @enImplNote:
4971      (text | anyForeignElement)*      (text | anyForeignElement)*
4972    
4973    ## -- Atom Threading Extension [RFC 4685]
4974    
4975    IFClsDef:
4976      @IFQName: AtomEntryElementThread
4977      @ClsQName: ManakaiAtomEntryElementThread
4978    
4979      @ClsISA: ManakaiAtomEntryElement
4980    
4981      @f:implements: AtomThreadingFeature10
4982    
4983      @enDesc:
4984        If the feature <Feature^^DISCore|QName::AtomThreadingFeature10>
4985        is supported, any <IF::Element> whose element type
4986        is <XE::atom|entry> <kwd:MUST> implement the <IF::AtomEntryElementThread>
4987        interface in addition to other appropriate interfaces.
4988    
4989      @Test:
4990        @@QName: AtomEntryElementThread.1.test
4991        @@PerlDef:
4992          my $doc;
4993          __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
4994    
4995          my $el = $doc->create_element_ns (<Q::atom|>, 'entry');
4996    
4997          $test->id ('interface');
4998          $test->assert_isa ($el, <IFName::AtomEntryElementThread>);
4999    
5000          $test->id ('feature');
5001          $test->assert_true ($el->is_supported (<Q::fe|AtomThreading> => '1.0'));
5002    
5003      @Attr:
5004        @@Name: threadInReplyToElements
5005        @@enDesc:
5006          A static list of <XE::thr|in-reply-to> child elements of the node.
5007        @@Type: StaticNodeList
5008        @@Get:
5009          @@@enDesc:
5010            It <kwd:MUST> <I::return a <XE::thr|in-reply-to> child element list>
5011            of the node.
5012          @@@PerlDef:
5013            __CODE{returnChildElementList::
5014              $node => $self,
5015              $namespaceURI => {<Q::thr|>},
5016              $localName => 'in-reply-to',
5017              $r => $r,
5018            }__;
5019    ##AtomEntryElementThread
5020    
5021    IFClsETDef:
5022      @IFQName: AtomThreadInReplyToElement
5023      @ETQName: thr|in-reply-to
5024      @ETRQName: thr|in-reply-to
5025      @ClsQName: ManakaiAtomThreadInReplyToElement
5026    
5027      @IFISA: AtomDateConstruct
5028      @ClsISA: ManakaiAtomDateConstruct
5029    
5030      @f:implements: AtomThreadingFeature10
5031      @mv:refers: atomCommonAttributes
5032    
5033      @cm: undefinedContent
5034    
5035      @enDesc:
5036        The <XE::thr|in-reply-to> element is used to indicate
5037        that an entry is a response to another resource.
5038    
5039        If the entry is a response to multiple resources,
5040        additional <XE::thr|in-reply-to> element <kwd:MAY>
5041        be used.
5042    
5043        RFC 4685 assigns no significance to the order in which
5044        multiple <XE::thr|in-reply-to> element appear within
5045        an entry.
5046    
5047      @Test:
5048        @@QName: AtomThreadInReplyToElement.1.test
5049        @@PerlDef:
5050          my $doc;
5051          __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
5052    
5053          my $el = $doc->create_element_ns (<Q::thr|>, 'in-reply-to');
5054    
5055          $test->id ('interface');
5056          $test->assert_isa ($el, <IFName::AtomThreadInReplyToElement>);
5057    
5058          $test->id ('feature');
5059          $test->assert_true ($el->is_supported (<Q::fe|AtomThreading> => '1.0'));
5060    
5061      @ATTR:
5062        @@Name: ref
5063        @@enDesc:
5064          The <XA::ref> attribute of the element.
5065    
5066          It <kwd:MUST> <I::reflect the URI value
5067          of the <XA::ref> attribute> of the node.
5068    
5069          The <XA::ref> attribute specifies the persistent,
5070          universally unique identifier of the resource being
5071          responded to.  The value <kwd:MUST> conform to
5072          the same construction and comparison rules as the
5073          value of the <XE::atom|id> element.  Though the IRI
5074          might use a dereferenceable scheme, processors <kwd:MUST-NOT>
5075          assume that it can be dereferenced.
5076    
5077          The <XE::thr|in-reply-to> element <kwd:MUST> contain
5078          a <XA::ref> attribute identifying the resource that
5079          is being respnoded to.
5080    
5081          If the resource being responded to does not have a persistent,
5082          universally unique identifier, the publisher <kwd:MUST> assign an
5083          identifier that satisfies all the considerations in Section 4.2.6 of
5084          RFC 4287 for use as the value of the <XA::ref> attribute.
5085          In that case, if a representation of the resource can be retrieved
5086          from an IRI that can be used as a valid atom:id value, then this IRI
5087          <kwd:SHOULD> be used as the value of both the <XA::ref> and
5088          <XA::href> attributes.
5089        @@Type: DOMString
5090        @@actualType: DOMURI
5091        @@Get:
5092          @@@nullCase:
5093            @@@@enDesc:
5094              If the algorithm returns <DOM::null>.
5095          @@@PerlDef:
5096            __CODE{getReflectAttrURIValue::
5097              $node => $self,
5098              $namespaceURI => {null},
5099              $localName => 'ref',
5100              $r => $r,
5101              $defaultValue => {null},
5102            }__;
5103        @@Set:
5104          @@@nullCase:
5105            @@@@enDesc:
5106              Removes the attribute.
5107          @@@NodeReadOnlyError:
5108          @@@PerlDef:
5109            __CODE{setReflectAttrURIValue::
5110              $node => $self,
5111              $namespaceURI => {null},
5112              $localName => 'ref',
5113              $given => $given,
5114            }__;
5115            
5116      @ATTR:
5117        @@Name: source
5118        @@enDesc:
5119          The <XA::source> attribute of the element.
5120    
5121          It <kwd:MUST> <I::reflect the URI value
5122          of the <XA::source> attribute> of the node.
5123    
5124          The <XA::source> attribute <kwd:MAY> be used to specify the IRI
5125          of an Atom Feed or Entry Document containing an
5126          <XE::atom|entry> with an <XE::atom|id> value equal to the
5127          value of the <XA::ref> attribute.  The IRI specified <kwd:MUST>
5128          be dereferenceable.
5129        @@Type: DOMString
5130        @@actualType: DOMURI
5131        @@Get:
5132          @@@nullCase:
5133            @@@@enDesc:
5134              If the algorithm returns <DOM::null>.
5135          @@@PerlDef:
5136            __CODE{getReflectAttrURIValue::
5137              $node => $self,
5138              $namespaceURI => {null},
5139              $localName => 'source',
5140              $r => $r,
5141              $defaultValue => {null},
5142            }__;
5143        @@Set:
5144          @@@nullCase:
5145            @@@@enDesc:
5146              Removes the attribute.
5147          @@@NodeReadOnlyError:
5148          @@@PerlDef:
5149            __CODE{setReflectAttrURIValue::
5150              $node => $self,
5151              $namespaceURI => {null},
5152              $localName => 'source',
5153              $given => $given,
5154            }__;
5155            
5156      @ATTR:
5157        @@Name: href
5158        @@enDesc:
5159          The <XA::href> attribute of the element.
5160    
5161          It <kwd:MUST> <I::reflect the URI value
5162          of the <XA::href> attribute> of the node.
5163    
5164          The <XA::href> attribute specifies an IRI that may be used
5165          to retrieve a representation of the resource being
5166          responded to.  The IRI specified <kwd:MUST> be
5167          dereferenceable.
5168        @@Type: DOMString
5169        @@actualType: DOMURI
5170        @@Get:
5171          @@@nullCase:
5172            @@@@enDesc:
5173              If the algorithm returns <DOM::null>.
5174          @@@PerlDef:
5175            __CODE{getReflectAttrURIValue::
5176              $node => $self,
5177              $namespaceURI => {null},
5178              $localName => 'href',
5179              $r => $r,
5180              $defaultValue => {null},
5181            }__;
5182        @@Set:
5183          @@@nullCase:
5184            @@@@enDesc:
5185              Removes the attribute.
5186          @@@NodeReadOnlyError:
5187          @@@PerlDef:
5188            __CODE{setReflectAttrURIValue::
5189              $node => $self,
5190              $namespaceURI => {null},
5191              $localName => 'href',
5192              $given => $given,
5193            }__;
5194      
5195      @ATTR:
5196        @@Name: type
5197        @@enDesc:
5198          The <XA::type> attribute of the element.
5199    
5200          It <kwd:MUST> <I::reflect the string value
5201          of the <XA::type> attribute> of the node.
5202    
5203          The <XA::type> attribute <kwd:MAY> be used to provide
5204          a hint to the client about the media type of the
5205          resource identified by the <XA::href> attribute.
5206          The <XA::type> attribute is only meaningful if a
5207          corresponding <XA::href> attribute is also provided.
5208        @@Type: DOMString
5209        @@Get:
5210          @@@nullCase:
5211            @@@@enDesc:
5212              If the algorithm returns <DOM::null>.
5213          @@@PerlDef:
5214            __CODE{getReflectAttrStringValue::
5215              $node => $self,
5216              $namespaceURI => {null},
5217              $localName => 'type',
5218              $r => $r,
5219              $defaultValue => {null},
5220            }__;
5221        @@Set:
5222          @@@nullCase:
5223            @@@@enDesc:
5224              Removes the attribute.
5225          @@@NodeReadOnlyError:
5226          @@@PerlDef:
5227            __CODE{setReflectAttrStringValue::
5228              $node => $self,
5229              $namespaceURI => {null},
5230              $localName => 'type',
5231              $given => $given,
5232            }__;
5233    ##AtomThreadInReplyToElement
5234    
5235    IFClsDef:
5236      @IFQName: AtomLinkElementThread
5237      @ClsQName: ManakaiAtomLinkElementThread
5238    
5239      @ClsISA: ManakaiAtomLinkElement
5240    
5241      @f:implements: AtomThreadingFeature10
5242    
5243      @enDesc:
5244        An <XE::atom|link> element with a <XA::rel> attribute value of
5245        <XML::replies> may be used to reference a resource where responses
5246        to an entry may be found.  If the <XA::type> attribute of the
5247        <XE::atom|link> is omitted, its value is assumed to be
5248        <XML::application/atom+xml>.
5249    
5250        A <XML::replies> link appearing as a child of the <XE::atom|feed>
5251        or <XE::atom|source> element indicates that the referenced
5252        resource likely contains responses to any of that
5253        feed's entries.  A <XML::replies>
5254        link appearing as a child of an <XE::atom|entry> element
5255        indicates that the linked resource likely contains responses
5256        specific to that entry.
5257    
5258        If the feature <Feature^^DISCore|QName::AtomThreadingFeature10>
5259        is supported, any <IF::Element> whose element type
5260        is <XE::atom|link> <kwd:MUST> implement the <IF::AtomLinkElementThread>
5261        interface in addition to other appropriate interfaces.
5262    
5263      @Test:
5264        @@QName: AtomLinkElementThread.1.test
5265        @@PerlDef:
5266          my $doc;
5267          __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
5268    
5269          my $el = $doc->create_element_ns (<Q::atom|>, 'link');
5270    
5271          $test->id ('interface');
5272          $test->assert_isa ($el, <IFName::AtomLinkElementThread>);
5273    
5274          $test->id ('feature');
5275          $test->assert_true ($el->is_supported (<Q::fe|AtomThreading> => '1.0'));
5276    
5277      @ATTR:
5278        @@Name: threadCount
5279        @@enDesc:
5280          The <XA::thr|count> attribute of the element.
5281    
5282          It <kwd:MUST> <I::reflect the non-negative integer value
5283          of the <XA::thr|count> attribute> of the node.
5284    
5285          An <XE::atom|link> element using the <XML::replies>
5286          <XA::rel> attribute value <kwd:MAY> contain
5287          a <XA::thr|count> attribute whose value is a
5288          non-negative integer that provides a hint to clients
5289          as to the total number of replies contained by the
5290          linked resource.  The value is advisory and
5291          may not accurately reflect the actual number of replies.
5292        @@Type: idl|long||ManakaiDOM|all
5293        @@Get:
5294          @@@PerlDef:
5295            __CODE{getReflectAttrNonNegativeIntegerValue::
5296              $node => $self,
5297              $namespaceURI => {<Q::thr|>},
5298              $localName => 'count',
5299              $r => $r,
5300              $defaultValue => {null},
5301            }__;
5302        @@Set:
5303          @@@NodeReadOnlyError:
5304          @@@PerlDef:
5305            __CODE{setReflectAttrNonNegativeIntegerValue::
5306              $node => $self,
5307              $namespaceURI => {<Q::thr|>},
5308              $localName => 'count',
5309              $given => $given,
5310            }__;
5311    
5312        @@Test:
5313          @@@QName: AtomLinkElementThread.threadCount.1.test
5314          @@@PerlDef:
5315            my $doc;
5316            __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
5317    
5318            my $link = $doc->create_element_ns (<Q::atom|>, 'link');
5319    
5320            $test->id ('default');
5321            $test->assert_num_equals
5322                     (expected_value => -1,
5323                      actual_value =>
5324                        $link-><AG::AtomLinkElementThread.threadCount>);
5325    
5326            $test->id ('zero');
5327            $link-><AS::AtomLinkElementThread.threadCount> (0);
5328            $test->assert_num_equals
5329                     (expected_value => 0,
5330                      actual_value =>
5331                        $link-><AG::AtomLinkElementThread.threadCount>);
5332            $test->id ('zero.attr');
5333            $test->assert_equals ($link->get_attribute_ns (<Q::thr|>, 'count'), '0');
5334    
5335            $test->id ('one');
5336            $link-><AS::AtomLinkElementThread.threadCount> (1);
5337            $test->assert_num_equals
5338                     (expected_value => 1,
5339                      actual_value =>
5340                        $link-><AG::AtomLinkElementThread.threadCount>);
5341            $test->id ('one.attr');
5342            $test->assert_equals ($link->get_attribute_ns (<Q::thr|>, 'count'), '1');
5343    
5344            $test->id ('10000');
5345            $link-><AS::AtomLinkElementThread.threadCount> (10000);
5346            $test->assert_num_equals
5347                     (expected_value => 10000,
5348                      actual_value =>
5349                        $link-><AG::AtomLinkElementThread.threadCount>);
5350            $test->id ('10000.attr');
5351            $test->assert_equals ($link->get_attribute_ns (<Q::thr|>, 'count'),
5352                                  '10000');
5353    
5354            $test->id ('+10000');
5355            $link->set_attribute_ns (<Q::thr|>, 'thr:count', '+10000');
5356            $test->assert_num_equals
5357                     (expected_value => 10000,
5358                      actual_value =>
5359                        $link-><AG::AtomLinkElementThread.threadCount>);
5360    
5361            $test->id ('010000');
5362            $link->set_attribute_ns (<Q::thr|>, 'thr:count', '010000');
5363            $test->assert_num_equals
5364                     (expected_value => 10000,
5365                      actual_value =>
5366                        $link-><AG::AtomLinkElementThread.threadCount>);
5367    
5368            $test->id ('-100');
5369            $link-><AS::AtomLinkElementThread.threadCount> (-100);
5370            $test->assert_num_equals
5371                     (expected_value => -1,
5372                      actual_value =>
5373                        $link-><AG::AtomLinkElementThread.threadCount>);
5374            $test->id ('-100.attr');
5375            $test->assert_false ($link->has_attribute_ns (<Q::thr|>, 'count'));
5376    
5377            $test->id ('120a');
5378            $link->set_attribute_ns (<Q::thr|>, 'thr:count', '120a');
5379            $test->assert_num_equals
5380                     (expected_value => -1,
5381                      actual_value =>
5382                        $link-><AG::AtomLinkElementThread.threadCount>);
5383    
5384            $test->id ('-1');
5385            $link-><AS::AtomLinkElementThread.threadCount> (-1);
5386            $test->assert_num_equals
5387                     (expected_value => -1,
5388                      actual_value =>
5389                        $link-><AG::AtomLinkElementThread.threadCount>);
5390            $test->id ('-1.attr');
5391            $test->assert_false ($link->has_attribute_ns (<Q::thr|>, 'count'));
5392    
5393      @enImplNote:
5394        @@ddid: updated
5395        @@@:
5396          {TODO::
5397            <XA::thr|updated> attribute
5398          }
5399    ##AtomLinkElementThread
5400    
5401    enImplNote:
5402      @@ddid: total
5403      @@@:
5404        {TODO::
5405          <XE::thr|total>
5406        }
5407    
5408    enImplNote:
5409      @@ddid: threaddtd
5410      @@@:
5411        {TODO::
5412          DTD impl for threading
5413        }

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

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24