属性値のための xml: :attr


#1

At 17:31 08/10/21, Tanaka A. wrote:

xml: :attr e$B$rE,MQ$7$?7k2L$rB0@-CMA4BN$H$7$F;HMQ$9$k$N$,$*A&e(B
e$B$a$G$9!#e(B

e$B@h$:!"$3$l$OMQ8l$NLdBj$@$1$+$b$7$l$^$;$s$,!"e(B
e$BB0@-CM$O0zMQIt$NCf$N$b$N$G!"0zMQId$r4^$_$^$;$s!#e(B

irb(main):001:0> s = &<>\uabcd"
=> &<>\xEA\xAF\x8D"
irb(main):002:0> s.encode(US-ASCII), xml: :attr)
=> &"<>""
irb(main):003:0> s.encode(US-ASCII), xml: :text)
=> &<>"

e$BJQ49$N$D$$$G$K0zMQId$rIU$1$k$3$H$,JXMx$H$$$&$H$-$b$"$k$+$H;W$$$^$9$,!"e(B
(1) xml: :text e$B$He(B xml: :attr e$B$G?6$kIq$$$,0c$&$H!"e(B
(2) e$BB0@-CM$N0lIt$@$1$rJ8;z%3!<%IJQ49$7$J$$$H$$$1$J$$>l9g$K$Oe(B
e$B$I$&$7$?$i$$$$$N$+e(B
e$B$H$$$&Fs$D$N$3$H$r9M$($k$H!e(Bxml: :attr e$B$N;~$K7k2L$re(B
&<>
e$B$K$9$Y$-$G$O$J$$$+$H;W$$$^$9!#e(B(1) e$B$OEDCf$5$s$,@bL@$7$?e(B Ruby
e$B$Ne(B
e$B!VI,$:$7$b0l4S@-$r:GM%@h$K$7$J$$!W$N$GL5;k$G$-$k$+$b$7$l$^$;$s$,!"e(B
(2) e$BHV$N;~$K$O$I$&$9$l$P$$$$$N$G$7$g$&$+!#e(B

e$B59$7$/$*4j$$$7$^$9!#e(B Martin.

#-#-# Martin J. Du"rst, Assoc. Professor, Aoyama Gakuin University
#-#-# http://www.sw.it.aoyama.ac.jp mailto:removed_email_address@domain.invalid


#2

In article 6.0.0.20.2.20081021175657.0ae04648@localhost,
Martin D. removed_email_address@domain.invalid writes:

e$BB0@-CM$O0zMQIt$NCf$N$b$N$G!"0zMQId$r4^$_$^$;$s!#e(B

e$B;d$N$$$C$?B0@-CM$Oe(B AttValue e$B$r;X$7$F$$$k$H$*9M$($/$@$5$$!#e(B

http://www.w3.org/TR/2006/REC-xml-20060816/

[10] AttValue ::= " ([^<&"] | Reference)* "
| ([^<&] | Reference)*

AttValue e$B$O0zMQId$r4^$_$^$9!#e(B

e$BJQ49$N$D$$$G$K0zMQId$rIU$1$k$3$H$,JXMx$H$$$&$H$-$b$"$k$+$H;W$$$^$9$,!"e(B

e$B;d$,e(B e$B$rIU$1$k$h$&$K$7$?M}M3$Oe(B double escape
e$BKI;_$G$9!#e(B
e$BJXMx$H$$$&$h$j$O%;%-%e%j%F%#>e$NOC$G$9!#e(B

(2) e$BB0@-CM$N0lIt$@$1$rJ8;z%3!<%IJQ49$7$J$$$H$$$1$J$$>l9g$K$Oe(B
e$B$I$&$7$?$i$$$$$N$+e(B

(2) e$BHV$N;~$K$O$I$&$9$l$P$$$$$N$G$7$g$&$+!#e(B

e$B$I$&$$$&$H$-$KB0@-CM$N0lIt$@$1$rJ8;z%3!<%IJQ49$7$J$$$H$$$1$J$$e(B
e$B>u67$,@8$8$k$s$G$9$+e(B?