What is an XML Namespace, and what does it have to do with Spring Transactions? -
i went through spring transaction tutorial mentions there elements available declarative transaction management , defined in tx namespace. tx namespace contain. defined, registered etc? why need namespace?
i want know in general namespaces not specific tx namespace.
an xml namespace token that, lack of better description, identifies "version" particular tag or attribute is. idea prevent conflicts if, instance, you're using xml elements defined multiple people/programs/standards bodies/etc. instance, program write uses xml might use namespace http://www.ttdi.us/xml/myapp
. then, can define tags <name>
without worrying somewhere else, might using <name>
own purposes:
<thing xmlns="http://www.ttdi.us/xml/myapp" xmlns:pie="http://somebodyelse.example/delicious/pie"> <!-- defines have "thing" in namespace "http://www.ttdi.us/xml/myapp" --> <!-- says prefix pie: different namespace. --> <name color="brown" pie:color="crispy">bob</name> <!-- tag has color "brown" attribute in namespace "crispy" in somebodyelse's pie namespace. can use same tag/attribute names without trouble. --> <pie:flavor>blueberry</pie:flavor> </thing>
a namespace need not "registered" anywhere; can uri want.
in short, if you're making own xml documents , think it's bits of other xml embedded in yours or vice-versa, it's worth declaring namespace.
so, spring tx
namespace merely way of identifying things "belong to" spring transactions in xml configuration document. visiting the url of spring tx namespace leads xml schemas (rules elements, attributes, , values can have) various versions of spring transactions. more information configuration settings can use in spring's documentation.
Comments
Post a Comment