संक्षिप्त उत्तर: क्योंकि <
char को <
और >
(XML परिभाषा के अनुसार) के बीच अनुमति नहीं है।
अगला प्रश्न किया जाना चाहिए
समाधान (जैसे एमएस ब्लेंड/दृश्य स्टूडियो में) "मैं एक XML/XAML विशेषता बाहर टिप्पणी कर सकते हैं" एक mc:Ignorable
विशेषता है।
<RootElement
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DataContext="this is an attribute for design time only"
>
तो अगर आप बाहर टिप्पणी करना चाहते हैं, बस विशेषता
को d:
उपसर्ग जोड़ने और अधिक उपयोगी आप और अधिक के रूप में एक से अनदेखा करने उपसर्ग हो सकता होने के लिए:
<RootElement
xmlns ="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x ="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d ="http://schemas.microsoft.com/expression/blend/2008"
xmlns:rem ="http://schemas.microsoft.com/expression/blend/2008"
xmlns:TODO ="http://schemas.microsoft.com/expression/blend/2008"
xmlns:DISABLED ="http://schemas.microsoft.com/expression/blend/2008"
xmlns:NOTE ="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d rem TODO DISABLED NOTE"
d:Foo="this is ignored (design time only attribute)"
rem:Background="this is also ignored (commented out)"
TODO:Background=" (commented as TODO)"
DISABLED:Background="this is also ignored (commented as DISABLED)"
>
"टोकन" rem
TODO
DISABLED
NOTE
केवल मेरे सुझाव हैं और किसी अन्य (वैध XML नाम) संभव हैं।
किसी भी तत्व में व्यावहारिक नमूना:
यूनिकोड वर्ण की निम्न सूची एक्सएमएल नाम लिए मान्य नहीं हैं:
ᆞ
ᅳ
ǀ
ǁ
ǂ
ǃ
ᅀ
<TextBox
DISABLED:Background="#FF000000" NOTE:Background="temporary disabled"
Background="#FFFFFF" TODO:Background="specify an other background"
TODO:TextBox="complete the textbox"
>
यूनिकोड वर्ण का उपयोग प्रलेखन के रूप में
उपयोग (एक्सएमएल टिप्पणियाँ)
<RootElement
...
xmlns:doc="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="... doc ..."
<MyControl
doc.summary="shows my control"
doc.remarks="any remarks..."
/>
>
WPF: एक कदम आगे, दो कदम पीछे। यह सब डब्लूपीएफ पर है, है ना। –