![]() ![]() |
Sep 6 2007, 12:12 PM
Post
#1
|
|
|
Newbie ![]() Group: Members Posts: 68 Joined: 2-August 07 From: Norway Member No.: 16,044 Languages: English, Norwegian and some German |
This post:
Can we have multiple target namespaces for an XSD file inspired me to write the following, that I hope will clear some misunderstandings if you can answer 90 % of the questions correct:
|
|
|
|
Sep 6 2007, 01:13 PM
Post
#2
|
|
|
XSLT senior ![]() ![]() ![]() ![]() ![]() ![]() Group: Moderator Posts: 5,186 Joined: 2-October 05 From: europe://Bulgaria/Plovdiv Member No.: 70 Languages: (X)HTML, CSS, XML, XSLT, Schema, PHP, JavaScript (a little), other XML based... |
Excuse me, but who should answer that? W3Schools? If so, this should have been in the suggestions forum. If it's suppose to be someone else that knows (like myself for example (IMG:http://w3schools.invisionzone.com/style_emoticons/default/rolleyes.gif) ), here I go:
|
|
|
|
Sep 7 2007, 11:14 AM
Post
#3
|
|
|
Newbie ![]() Group: Members Posts: 68 Joined: 2-August 07 From: Norway Member No.: 16,044 Languages: English, Norwegian and some German |
First of all there is a relation between question 5 and 14. Name spaces are used to eliminate ambiguities and make elements and attributes unique. Name spaces are created using a special prefixed name and a URI like this:
xmlns:prefix="URI". I am in a hurry, before I comment on each answer I will come back and post a cryptical example that may make the points clearer. Though, I hope for a deeper discussion, if possible, before that is done. Understanding and using name spaces correctly can save you hours / days and weeks of frustration working with your XML documents, your native XML database (NXD) or XML CMS. |
|
|
|
Sep 7 2007, 08:38 PM
Post
#4
|
|
|
XSLT senior ![]() ![]() ![]() ![]() ![]() ![]() Group: Moderator Posts: 5,186 Joined: 2-October 05 From: europe://Bulgaria/Plovdiv Member No.: 70 Languages: (X)HTML, CSS, XML, XSLT, Schema, PHP, JavaScript (a little), other XML based... |
Yes. Examples. I forgot about that. Sorry.
Namespaces may become more clear if you imagine each XML document as a namespaceURI/local-name pair, as it's truly is. For theese examples, let us mark namespaces with "{namespaceURI}" and omit the namespace declarations. Regardless of the prefix you use, or if you don't use a prefix at all, what matters is the URI at the end. So, the following two XMLs: CODE <root xmlns="http://example.com" xmlns:f="http://w3.org"> <f:element/> <myElement> <f:myElement/> </myElement> </root> CODE <f:root xmlns:f="http://example.com" xmlns="http://w3.org"> <element/> <f:myElement> <myElement/> </f:myElement> </f:root> are both resolved to: CODE <{http://example.com}root> <{http://w3.org}element/> <{http://example.com}myElement> <{http://w3.org}myElement/> </{http://example.com}myElement> </{http://example.com}root> NOTE: the last one is just shown like that for clarity. It is NOT how XML documents look like when open or parsed. And the following example shows how are default namespaces resolved when within the document. The XMLs: CODE <f:root xmlns:f="http://example.com" xmlns="http://w3.org"> <element/> <f:myElement> <myElement xmlns="http://example.com"> <element/> </myElement> </f:myElement> </f:root> Resolves to CODE <{http://example.com}root> <{http://w3.org}element/> <{http://example.com}myElement> <{http://example.com}myElement> <{http://example.com}element/> </{http://example.com}myElement> </{http://example.com}myElement> </{http://example.com}root> Notice how the non prefixed myElement element and it's child element node are now in the http://example.com namespace, even though they are without a prefix. That's again because it doesn't matter what prefix you use, if any, as long as the final outcome is what you want. |
|
|
|
Sep 10 2007, 12:39 PM
Post
#5
|
|
|
Newbie ![]() Group: Members Posts: 68 Joined: 2-August 07 From: Norway Member No.: 16,044 Languages: English, Norwegian and some German |
I am still in a hurry on, holliday away from my own computer.
Great. I will study your code in more detail. Thoughts: What about collision of (short) namespace names? How to avoid that? In C++ there are two solutions, using-declarations and usning-directives where the first is more specific. What about name space aliases. Note, in C++ a class is a name space, but a name space is not a class, among other things because a name space is open in C++. What about nested name spaces? A::B::x where A and B are name spaces. Is the global name space :: the same as the (a) default name space? |
|
|
|
Sep 10 2007, 07:03 PM
Post
#6
|
|
|
XSLT senior ![]() ![]() ![]() ![]() ![]() ![]() Group: Moderator Posts: 5,186 Joined: 2-October 05 From: europe://Bulgaria/Plovdiv Member No.: 70 Languages: (X)HTML, CSS, XML, XSLT, Schema, PHP, JavaScript (a little), other XML based... |
Depends on what you mean by short namespace names.
If you mean short prefixes, again, the prefix is irrelevant, as long as the URI is the same. So even though XSLT stylesheets usually use the "xsl" prefix, you can safely use "whateverPrefixYouWant" as prefix, provided it's still pointing to the XSLT namespace URI. If you mean short URIs. That's very unlikely, as language authors usually use their own domain for namespace URIs. It's unlikely that anyone else would want to use your domain instead of their own (which doesn't even have to exist to begin with anyway). Why would you for example create a dialect that uses the "http://microsoft.com" namespace, when you could use "http://yourDomain.com" instead? There are no nested namespaces in XML. There are nested namespace declarations, which override any previously defined namespaces (there are examples on that above), but there's no inheritance. The reason is simple - simplification (pun intended). Oh, and portability too (being able to insert one language into another without explicitly defining that you expect it). |
|
|
|
Sep 13 2007, 11:17 AM
Post
#7
|
|
|
Newbie ![]() Group: Members Posts: 68 Joined: 2-August 07 From: Norway Member No.: 16,044 Languages: English, Norwegian and some German |
There are no nested namespaces in XML. There are nested namespace declarations, which override any previously defined namespaces (there are examples on that above), but there's no inheritance. The reason is simple - simplification (pun intended). Oh, and portability too (being able to insert one language into another without explicitly defining that you expect it). To follow up the discussion, before a summary is written in x posts. The cryptical example will be given in y posts. 1. What do you mean by a target name space in an XSD schema? 2. Why and how do you use include to combine separate schemas into a master schema? 3. Why and how do you use import to combine separate schemas into a master schema? 4. What do you mean by a name space attribute on elements in a schema and which rules apply to this attribute? The following cite is from Robert Richards (2006) "Pro PHP XML and Web Services" page 100. "XML schemas have great extensibility - not only using user-derived types but also from nested include and import possibilities." What does he mean? |
|
|
|
Sep 13 2007, 01:54 PM
Post
#8
|
|
|
XSLT senior ![]() ![]() ![]() ![]() ![]() ![]() Group: Moderator Posts: 5,186 Joined: 2-October 05 From: europe://Bulgaria/Plovdiv Member No.: 70 Languages: (X)HTML, CSS, XML, XSLT, Schema, PHP, JavaScript (a little), other XML based... |
|
|
|
|
Sep 13 2007, 04:20 PM
Post
#9
|
|
|
Newbie ![]() Group: Members Posts: 68 Joined: 2-August 07 From: Norway Member No.: 16,044 Languages: English, Norwegian and some German |
I will reply later, now only collecting information. A short comment though, one obvious use of separate schema files is a large company / institution where different departments make their own schema that are consolidated into a master schema (that may be available on the intranet) at the corporate level.
To continue: 1. What does isomorphic and polymorphic mean in mathematics? 2. Give the W3C URL for - the XML-Signature Syntax and Processing specification and - the XML- Encryption Syntax and Processing specification. 3. What does it mean to serialize and unzerialize data? How are XML documents serialized? Name a PHP function that is used to serialize data and another that is used to unzerialize data? Can data be lost under serialization and what are the implications for XML documents? 4. What is and why is canonical XML important? 5. What is exclusive canonical XML? 6. How are namespaces treated and name space nodes processed (to canonical XML) under canonical and exclusive canonical XML respectively? 7. What is an Inclusive Namespace PrefixList parameter and how is it used? 8. What is an XML signature and what does super encryption mean? 9. On page 467 in the above mentioned book R Richards writes: "Caution: When creating the signature document manually using the DOM API, the Signature element defines the default namespace http://www.w3.org/2000/09/xmldsig#. Elements within its scope must be created usning namespace-aware methods, such as createElementNS, in order for this to work properly." What does he mean? |
|
|
|
Sep 13 2007, 07:11 PM
Post
#10
|
|
|
XSLT senior ![]() ![]() ![]() ![]() ![]() ![]() Group: Moderator Posts: 5,186 Joined: 2-October 05 From: europe://Bulgaria/Plovdiv Member No.: 70 Languages: (X)HTML, CSS, XML, XSLT, Schema, PHP, JavaScript (a little), other XML based... |
(note: you should really check out PHP's DOM reference if you're using PHP. If not, check the reference of your S3L of choise for DOM) |
|
|
|
Sep 14 2007, 12:04 PM
Post
#11
|
|
|
Newbie ![]() Group: Members Posts: 68 Joined: 2-August 07 From: Norway Member No.: 16,044 Languages: English, Norwegian and some German |
[*]In which language? PHP. Much noise here, especially on (exclusive) canonical XML and some regarding serialization. Under serialization, writing an XML document to a stream or a file, you may loose information / structure in the new state of the document. This is related to (exclusive) canonical XML and XML security. You find the canonical XML specification at http://www.w3.org/TR/xml-c14n that establishes a method for determining whether two documents are identical. The canonical form is very important to understand since it is related to enterprise security of XML documents. Two documents are considered identical if they have the same canonical form, even if the physical representations are not identical. Among other things superfluous namespace declarations are removed from each element and lexicographic order is imposed on namespace declarations and attributes of each element to convert a document to canonical form. When canoncial XML is applied to (a subset of) / the document, the serialized version may be much different. Dealing with digital signatures can become a nightmare. The original document no longer has the same canonical form even if it is the same document/subset. Trying to extract the subset and place it within a different context, such as within another document may become impossible. That is why you might also hear canonical XML referred to as inclusive canonical XML. It includes the context of a subset's ancestors. To deal with this issue, exlusive canonicalization was devised. It excludes, rather than includes, the context of a subset's ancestors. This means namespace declarations and attributes in the XML namespace from a subset's ancestors are not part of the canonicalization process when performing exclusive XML canonicalization. Read more in the above link and in Richards book chapter 12 where code examples are also given. The minimalistic explanation of super encryption is encrypting an already (partly) encrypted document. |
|
|
|
Sep 14 2007, 01:20 PM
Post
#12
|
|
|
Newbie ![]() Group: Members Posts: 68 Joined: 2-August 07 From: Norway Member No.: 16,044 Languages: English, Norwegian and some German |
Here is the very instructive cryptical example of how confusing (default) namespace(s) scope can be in XML documents. The example is from Richards page 33.
CODE <Order xmlns:cus="http://www.example.com/Customer" xmlns:item="http://www.example.com/Item" xmlns="http://www.example.com/Order"> <cus:Customers> <Customer xmlns:cus="http://www.example.com/GENERIC_Customer"> <cus:Name>John Smith</cus:Name> <cus:Number>12345</cus:Number> </Customer> <cus:Count>1</cus:Count> </cus:Customers> <item:Items> <item1:Item xmlns:item1="http://www.example.com/GENERIC_Item"> <item1:Name>Book</item1:Name> <item1:Number>11111</item1:Number> </item1:Item> <Item xmlns:item="http://www.example.com/GENERIC_Item"> <item:Name>Software</item:Name> <item:Number>22222</item:Number> </Item> </item:Items> <GeneralInfo xmlns="http://www.example.com/General"> <Name>General Information</Name> <Number>33333</Number> </GeneralInfo> </Order> 1. Is it by coloring code, possible to explain namespace scope and scope genreally? Use two or more versions of colored code if necessary. 2. How many default name spaces are there and which one (color?)? 3. This is a small document example handling namespaces. Go back to the preceeding posts and correct any wrong answers and explain in more detail why you think the title of this post was "Let us play the name space game"? Correct or supplement other answers that you think could have been explained or answered better. Where are other web surfers? Any other opinions on WWW? |
|
|
|
Sep 14 2007, 07:02 PM
Post
#13
|
|
|
XSLT senior ![]() ![]() ![]() ![]() ![]() ![]() Group: Moderator Posts: 5,186 Joined: 2-October 05 From: europe://Bulgaria/Plovdiv Member No.: 70 Languages: (X)HTML, CSS, XML, XSLT, Schema, PHP, JavaScript (a little), other XML based... |
I still don't get what you mean by that "Inclusive Namespace PrefixList parameter". Where did you saw it? Link?
Before "deciphering" the document, let me first indent it. Indentation allows you to see the hierarchy of a document, making it easier to judge namespaces too, since they are inherited from the parent element, unless otherwise overwritten. CODE <Order xmlns:cus="http://www.example.com/Customer" xmlns:item="http://www.example.com/Item" xmlns="http://www.example.com/Order"> <cus:Customers> <Customer xmlns:cus="http://www.example.com/GENERIC_Customer"> <cus:Name>John Smith</cus:Name> <cus:Number>12345</cus:Number> </Customer> <cus:Count>1</cus:Count> </cus:Customers> <item:Items> <item1:Item xmlns:item1="http://www.example.com/GENERIC_Item"> <item1:Name>Book</item1:Name> <item1:Number>11111</item1:Number> </item1:Item> <Item xmlns:item="http://www.example.com/GENERIC_Item"> <item:Name>Software</item:Name> <item:Number>22222</item:Number> </Item> </item:Items> <GeneralInfo xmlns="http://www.example.com/General"> <Name>General Information</Name> <Number>33333</Number> </GeneralInfo> </Order> Oh, and, lol... way too much namespaces! I got sick when even looking at them, so I wrote the following XSLT file (very quickly btw, so it may have some quirks) that resolves namespaces to the cryptic examples above. The stylesheet is this: CODE <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text"/> <xsl:template match="*"><{<xsl:value-of select="namespace-uri()"/>}<xsl:value-of select="local-name()"/><xsl:apply-templates select="@*"/>><xsl:apply-templates select="*|processing-instruction()|comment()|text()"/></{<xsl:value-of select="namespace-uri()"/>}<xsl:value-of select="local-name()"/>></xsl:template> <xsl:template match="@*"> {<xsl:value-of select="namespace-uri()"/>}<xsl:value-of select="local-name()"/>="<xsl:value-of select="."/>"</xsl:template> <xsl:template match="processing-instruction()"><?<xsl:value-of select="name()"/> <xsl:value-of select="."/>?></xsl:template> <xsl:template match="comment()"><!--<xsl:value-of select="."/>--></xsl:template> </xsl:stylesheet> (whitespace is important!) And the result I got with it from your XML was: CODE <{http://www.example.com/Order}Order> <{http://www.example.com/Customer}Customers> <{http://www.example.com/Order}Customer> <{http://www.example.com/GENERIC_Customer}Name>John Smith</{http://www.example.com/GENERIC_Customer}Name> <{http://www.example.com/GENERIC_Customer}Number>12345</{http://www.example.com/GENERIC_Customer}Number> </{http://www.example.com/Order}Customer> <{http://www.example.com/Customer}Count>1</{http://www.example.com/Customer}Count> </{http://www.example.com/Customer}Customers> <{http://www.example.com/Item}Items> <{http://www.example.com/GENERIC_Item}Item> <{http://www.example.com/GENERIC_Item}Name>Book</{http://www.example.com/GENERIC_Item}Name> <{http://www.example.com/GENERIC_Item}Number>11111</{http://www.example.com/GENERIC_Item}Number> </{http://www.example.com/GENERIC_Item}Item> <{http://www.example.com/Order}Item> <{http://www.example.com/GENERIC_Item}Name>Software</{http://www.example.com/GENERIC_Item}Name> <{http://www.example.com/GENERIC_Item}Number>22222</{http://www.example.com/GENERIC_Item}Number> </{http://www.example.com/Order}Item> </{http://www.example.com/Item}Items> <{http://www.example.com/General}GeneralInfo> <{http://www.example.com/General}Name>General Information</{http://www.example.com/General}Name> <{http://www.example.com/General}Number>33333</{http://www.example.com/General}Number> </{http://www.example.com/General}GeneralInfo> </{http://www.example.com/Order}Order> I'll let you explore the why and how after knowing what it all resolves to. As for coloring... I started playing with the above stylesheet and I currently have an XML highlighter, but not a namespace aware one. I'll keep working on it. I'll let you know where I am when I have some progress. The topic is called like that because a lot of the questions were about namespaces of course. Especially the ones in the first post. And why are you asking me to go back? Is this an interview or what? If it is, please let me see it when you're done (IMG:http://w3schools.invisionzone.com/style_emoticons/default/tongue.gif) . I mean a copy of the magazine or a link to the blogpost or whatever (IMG:http://w3schools.invisionzone.com/style_emoticons/default/laugh.gif) . |
|
|
|
Sep 14 2007, 07:36 PM
Post
#14
|
|
|
Newbie ![]() Group: Members Posts: 68 Joined: 2-August 07 From: Norway Member No.: 16,044 Languages: English, Norwegian and some German |
I still don't get what you mean by that "Inclusive Namespace PrefixList parameter". Where did you saw it? Link? In one of the books I am reading of course, Richards 2006 cited above, page 457 and 459. I can cite literally what is written there: Page 457: "Data Model. The data model for exclusive XML canonicalization is the same as that for canonical XML with a few exceptions. These exceptions, as previously noted, fall into the area of namespace declaration handling. You have already seen that a search of ancestor nodes not within the node set for namespace declarations and attributes from the XML namespace is not found under exclusive XML canonicalization. Serialization of namespace declarations themseleves also differs and depends upon a few factors. You can use an InclusiveNamespace PrefixList parameter with exclusive XML canonicalization. It is a list containing prefixes and/or token that indicates a defaulit namespace. This parameter plays a role how namespaced nodes are rendered in canonical form". Page 459: "InclusiveNamespace PrefixList The InclusiveNamespace PrefixList throws a little curve to the rules already defined for handling namespace nodes. A namespace node matching a prefix or token in the list is rendered according to the rules of canonical XML rather than those of exclusive XML canonicalization. Namespace nodes in the node set that match a prefix or token in the list, unlike those not in the list, do not need to have parent elements in the node set. This can make your output look a little strange because it can result in non-well formed XML, that is perfectly acceptable when generating a canonical form for a document subset." There are examples there that make the term even more clear. In a nutshell it is about how nodes are processed during the canonicalization process. Since the canonical form is important when securing XML documents, this is important too. You can do a lot of the canonicalization when you load the document like this: CODE $dom=new DOMDocument(); $dom->loadXML($xmlstring, LIBXML_NOENT | LIBXML_DTDLOAD | LIBXML_DTDATTR | LIBXML_NOCDATA); The resulting document may still contain irrelevant nodes that may be processed before the document is in (exclusive) canonical form. I can warmly recommed Richards book. Note it is about XML and PHP. |
|
|
|
Sep 14 2007, 08:54 PM
Post
#15
|
|
|
XSLT senior ![]() ![]() ![]() ![]() ![]() ![]() Group: Moderator Posts: 5,186 Joined: 2-October 05 From: europe://Bulgaria/Plovdiv Member No.: 70 Languages: (X)HTML, CSS, XML, XSLT, Schema, PHP, JavaScript (a little), other XML based... |
Heck, I'll have to read the whole book if I'm to get what he means by that.
And honestly said, I don't see why XML should be "secured". It should rely on HTTP security for transport and the application should simply process all variants it could handle. What's the deal? I really need to see a concrete example where this could be a problem. Btw, I think I've made a neat stylesheet now: CODE <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml"> <xsl:output method="html"/> <xsl:param name="targetNamespace"></xsl:param> <xsl:template match="/"> <html> <head> <title>Namespaces in the document</title> <style type="text/css"> .nonTargetNamespace,pre {color:inherit;background-color:#FFF;} .text {color:black;background-color:inherit;} .element {color:blue;background-color:inherit;} .attribute {color:brown;background-color:inherit;} .pi {color:purple;background-color:inherit;} .comment {color:gray;background-color:inherit;} .namespace {color:green;background-color:inherit;} .targetNamespace {color:inherit;background-color:yellow;} </style> </head> <body> <pre><?xml version="1.0"?> <xsl:apply-templates/> </pre> </body> </html> </xsl:template> <xsl:template name="isTarget"><xsl:choose><xsl:when test="namespace-uri() = $targetNamespace"> targetNamespace</xsl:when><xsl:otherwise> nonTargetNamespace</xsl:otherwise></xsl:choose></xsl:template> <xsl:template name="namespace">{<span class="namespace"><xsl:value-of select="namespace-uri()"/></span>}</xsl:template> <xsl:template match="*"><span><xsl:attribute name="class">element <xsl:call-template name="isTarget"/></xsl:attribute><<xsl:call-template name="namespace"/><xsl:value-of select="local-name()"/><xsl:apply-templates select="@*"/>></span><xsl:apply-templates select="*|processing-instruction()|comment()|text()"/><span><xsl:attribute name="class">element <xsl:call-template name="isTarget"/></xsl:attribute></<xsl:call-template name="namespace"/><xsl:value-of select="local-name()"/>></span></xsl:template> <xsl:template match="@*" xml:space="preserve"> <span><xsl:attribute name="class">attribute<xsl:call-template name="isTarget"/></xsl:attribute><xsl:call-template name="namespace"/><xsl:value-of select="local-name()"/>="<xsl:value-of select="."/>"</span></xsl:template> <xsl:template match="processing-instruction()" xml:space="preserve"><span class="pi"><?<xsl:value-of select="name()"/> <xsl:value-of select="."/>?></span></xsl:template> <xsl:template match="comment()"><span class="comment"><!--<xsl:value-of select="."/>--></span></xsl:template> <xsl:template match="text()"><span class="text"><xsl:value-of select="."/></span></xsl:template> </xsl:stylesheet> (again, whitespace is important!) All elements and attributes that are in the targetNamespace parameter (line 4) will be highlighted in yellow. Note that their text nodes won't be. I've deliberatly made it like this, so that if a nested element is not in that namespace, it wouldn't be highlighted. |
|
|
|
Sep 19 2007, 04:14 PM
Post
#16
|
|
|
Newbie ![]() Group: Members Posts: 68 Joined: 2-August 07 From: Norway Member No.: 16,044 Languages: English, Norwegian and some German |
Heck, I'll have to read the whole book if I'm to get what he means by that. And honestly said, I don't see why XML should be "secured". It should rely on HTTP security for transport and the application should simply process all variants it could handle. What's the deal? I really need to see a concrete example where this could be a problem. The Https protocol may be secure enough for you, but generally not. An obvious reason, is that the xml document is still readable. For some uses that is not good enough. Heck, I'll have to read the whole book if I'm to get what he means by that. For some readers of this thread that may be very important. There are layers of security:
|
|
|
|
Sep 21 2007, 10:44 AM
Post
#17
|
|
|
XSLT senior ![]() ![]() ![]() ![]() ![]() ![]() Group: Moderator Posts: 5,186 Joined: 2-October 05 From: europe://Bulgaria/Plovdiv Member No.: 70 Languages: (X)HTML, CSS, XML, XSLT, Schema, PHP, JavaScript (a little), other XML based... |
When you send data with HTTPS, the data (as in "the XML" in this case) is encrypted. That's what HTTPS is for anyway.
I mean, just what does each of those layers protect?
|
|
|
|
Sep 25 2007, 07:53 PM
Post
#18
|
|
|
Newbie ![]() Group: Members Posts: 68 Joined: 2-August 07 From: Norway Member No.: 16,044 Languages: English, Norwegian and some German |
Https=?
Secure transfer and encrypted communication? What about a person that picks up the document on your office? Your proposals are not secure enough for everybody readings these posts. You find a lot of real examples in the above mentioned book, that is the best I can reccomend you on PHP, XML and Web Services. May be not the best on security, but better than many other sources. |
|
|
|
Sep 26 2007, 09:19 AM
Post
#19
|
|
|
XSLT senior ![]() ![]() ![]() ![]() ![]() ![]() Group: Moderator Posts: 5,186 Joined: 2-October 05 From: europe://Bulgaria/Plovdiv Member No.: 70 Languages: (X)HTML, CSS, XML, XSLT, Schema, PHP, JavaScript (a little), other XML based... |
Https=? Secure transfer and encrypted communication? Yes. Without it (i.e. by using HTTP), the XML is sent "as is" be it cannonical or not. What about a person that picks up the document on your office? There's no protection to that one in the XML. The same could happen with a cannonical XML. A username and password for the transfer (i.e. HTTP authentication) are possible solutions, but they are still done on the HTTPS layer, rather then in the XML. Your proposals are not secure enough for everybody readings these posts. You find a lot of real examples in the above mentioned book, that is the best I can reccomend you on PHP, XML and Web Services. May be not the best on security, but better than many other sources. I wouldn't buy a book for a security consideration I don't see. If there's a problem and I can't think of a solution (or if I can't see cannonical XML as a solution), THEN I would buy a book to teach me on it (or more likely - find information online). Could you give a single example from the book or a link to any online resource for it? |
|
|
|
Sep 26 2007, 10:09 AM
Post
#20
|
|
|
Newbie ![]() Group: Members Posts: 68 Joined: 2-August 07 From: Norway Member No.: 16,044 Languages: English, Norwegian and some German |
There's no protection to that one in the XML. The same could happen with a cannonical XML. A username and password for the transfer (i.e. HTTP authentication) are possible solutions, but they are still done on the HTTPS layer, rather then in the XML. The point is that (parts of) the document is encrypted. Canonicalization is an important part of XML enterprise security. You come a long way with basic security. I think you can download parts of the code (may be enough) without buying the book at apress: http://www.apress.com/ Click on Books + Source Code and scroll down to "Pro PHP XML and Web Services". But there are much in the book that is not in that source code. I have the right to the eBook for USD 10. You have been the only person on the WWW responding to this important subject: If you promise to read chapter 12 on XML security and come back and comment after reading that chapter, I can buy it for you. You do not need to promise anything. You can get the right to the eBook if you want it. Then I think I must buy it and email it to you via a non secure protocol. |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 9th February 2010 - 11:11 PM |