You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@apache.org on 2001/05/18 23:22:19 UTC

cvs commit: xml-xalan/c/src/XSLT ElemAttribute.cpp

dbertoni    01/05/18 14:22:19

  Modified:    c/src/XSLT ElemAttribute.cpp
  Log:
  Generate a new prefix for xsl:attribute if that prefix is already mapped to a different namespace.
  
  Revision  Changes    Path
  1.24      +18 -1     xml-xalan/c/src/XSLT/ElemAttribute.cpp
  
  Index: ElemAttribute.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemAttribute.cpp,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- ElemAttribute.cpp	2001/05/14 01:03:07	1.23
  +++ ElemAttribute.cpp	2001/05/18 21:22:17	1.24
  @@ -240,8 +240,25 @@
   					    fPrefixIsXMLNS == false)
   					{
   						newPrefix = substring(origAttrName, 0, indexOfNSSep);
  +
  +						// OK, make sure that the prefix provided maps to
  +						// the same namespace as the one the user requested...
  +						const XalanDOMString* const	theNamespace =
  +							executionContext.getResultNamespaceForPrefix(newPrefix);
  +
  +						if (theNamespace != 0 &&
  +							equals(*theNamespace, attrNameSpace) == false)
  +						{
  +							// It doesn't, so we'll need to manufacture a
  +							// prefix.
  +							clear(newPrefix);
  +
  +							// Strip the user-supplied prefix from the name...
  +							attrName = substring(origAttrName, indexOfNSSep + 1);
  +						}
   					}
  -					else
  +
  +					if (length(newPrefix) == 0)
   					{
   						// If there's a prefix, and it's xmlns, then strip it
   						// off...
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org