xml part-6

XML Namespaces 

 
xml part-6
xml part-6
Steps to create XML namespaces 
सबसे पहले xmlns attribute define करिये। इसके बाद xmlns के आगे colon लगाकर एक prefix define कीजिये। ये वो prefix होता है जिससे आप create किये गए namespace में elements add करते है। इसके बाद assignment operator लगाकर एक unique domain URI define कीजिये। ये URI namespace को दूसरे namespace से differentiate करता है। 

Syntax for creating XML namespaces 
<?xml version="1.0">
<root-element xmlns:prefix="URI">
<prefix:sub-element>text</prefix:subelement>
</root-element>
  
आप चाहे तो एक से अधिक namespaces भी define कर सकते है इसका तरीका निचे दिया जा रहा हैं।

<?xml version="1.0">
<root-elment xmlns:prefix1="URI1" 
xmlns:prefix2="URI2">
<prefix1:sub-element>Content </prefix1:sub-element>
<prefix2:sub-element>Content</prefix2:sub-element>
</root-element>
 
Prefix 
Prefixes को अलग अलग namespaces में elements को add करवाने के लिए यूज़ किया जाता है। Prefixes namespaces को uniquely identify नहीं कर सकते है क्योंकि दो developers एक ही नाम के prefixes create कर सकते है। Prefixes का काम सिर्फ इतना होता है की आप इनसे namespaces में elements add कर सकते है।
URI 
URI's namespaces को uniquely identify करने के लिए यूज़ किये जाते है। सबसे बेहतर तरीका होता है की आप अपनी domain name से एक URL create कर ले

Share this

Related Posts

Previous
Next Post »

1 comments:

comments
January 30, 2018 at 5:44 AM delete

hello guys,have you ever wondered what your spouse is doing behind you?i was able to get proof that my ex husband was cheating on me through the help of a good samaritan which was referred to me by Mrs Jane.i messaged him and to my greatest suprise he's real and he got me result in less minutes,he's a great professional ,applause for him always as i told him i will let the world know him,do you have any problem spying on someone,track a cheating spouse,hack into text messages and phone calls,bank statement hacks and criminal records erased also you can boost your school grade,hack into whats' app,facebook,viber,emails,gmail and whatsoever related to hacking or your trying to get into a phone without the owner's consent,he's an expert and won't ever fail you. contact hackdigg at g mail dot com or text his number +15186284630 ,also you can text him on whats app or call him with this number on what's app +15185049376 and let him know i referred you.for sure he will help you.
Email:hackdigg at gmail dot com
Text num:+15186284630
what's app num:+15185049376
tell him Roseline referred you.

Reply
avatar

please comment your choice game ...