<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>8573</bug_id>
          
          <creation_ts>2009-12-31 16:12:37 +0000</creation_ts>
          <short_desc>F.1 Stylesheet for chameleons invalid</short_desc>
          <delta_ts>2010-08-18 20:04:49 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XML Schema</product>
          <component>Structures: XSD Part 1</component>
          <version>1.1 only</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>resolved</keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Hans-Juergen Rennau">hrennau</reporter>
          <assigned_to name="David Ezell">David_E3</assigned_to>
          <cc>cmsmcq</cc>
          
          <qa_contact name="XML Schema comments list">www-xml-schema-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>30302</commentid>
    <comment_count>0</comment_count>
    <who name="Hans-Juergen Rennau">hrennau</who>
    <bug_when>2009-12-31 16:12:37 +0000</bug_when>
    <thetext>The stylesheet contains several errors, e.g. referencing the context item within a stylesheet function. Proposed correction as follows. Another issue - the stylesheets &quot;forgets&quot; to handle the attribute &apos;memberTypes&apos; - is dealt with in a separate bug report.

With kind regards -
Hans-Juergen Rennau




&lt;xsl:transform version=&quot;2.0&quot;
               xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
               xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;
               xmlns:f=&quot;http://www.w3.org/2008/05/XMLSchema-misc&quot;&gt;

  &lt;xsl:param name=&quot;newTargetNamespace&quot; as=&quot;xs:anyURI&quot; 
      required=&quot;yes&quot;/&gt;
  &lt;xsl:param name=&quot;prefixForTargetNamespace&quot; as=&quot;xs:NCName&quot; 
      select=&quot;f:generateUniquePrefix(., 0)&quot;/&gt;

  &lt;xsl:template match=&quot;@*|node()&quot;&gt;
    &lt;xsl:copy&gt;&lt;xsl:apply-templates select=&quot;@*|node()&quot;/&gt;&lt;/xsl:copy&gt;
  &lt;/xsl:template&gt;

  &lt;xsl:template match=&quot;xs:schema&quot;&gt;
    &lt;xsl:copy&gt;
     &lt;xsl:namespace name=&quot;{$prefixForTargetNamespace}&quot; 
       select=&quot;$newTargetNamespace&quot;/&gt;
     &lt;xsl:apply-templates select=&quot;@*&quot;/&gt;
     &lt;xsl:attribute name=&quot;targetNamespace&quot; 
       select=&quot;$newTargetNamespace&quot;/&gt;
     &lt;xsl:apply-templates/&gt;
   &lt;/xsl:copy&gt;
  &lt;/xsl:template&gt;

  &lt;xsl:template match=&quot;attribute(*, xs:QName)
      [namespace-uri-from-QName(.)=&apos;&apos;]&quot;&gt;
    &lt;xsl:attribute name=&quot;{name()}&quot; 
      select=&quot;concat($prefixForTargetNamespace, 
                     &apos;:&apos;, 
                     local-name-from-QName(.))&quot;/&gt;
  &lt;/xsl:template&gt;

  &lt;xsl:function name=&quot;f:generateUniquePrefix&quot; as=&quot;xs:NCName&quot;&gt;
    &lt;xsl:param name=&quot;xsd&quot;/&gt;
    &lt;xsl:param name=&quot;try&quot; as=&quot;xs:integer&quot;/&gt;
    &lt;xsl:variable name=&quot;disallowed&quot; 
      select=&quot;distinct-values($xsd//*/in-scope-prefixes(.))&quot;/&gt;
    &lt;xsl:variable name=&quot;candidate&quot; 
      select=&quot;xs:NCName(concat(&apos;p&apos;, $try))&quot;/&gt;
    &lt;xsl:sequence select=&quot;if ($candidate = $disallowed) then 
                                f:generateUniquePrefix($xsd, $try+1) 
                             else 
                                $candidate&quot;/&gt;
  &lt;/xsl:function&gt;

&lt;/xsl:transform&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31057</commentid>
    <comment_count>1</comment_count>
    <who name="David Ezell">David_E3</who>
    <bug_when>2010-01-14 19:05:16 +0000</bug_when>
    <thetext>On the telcon on 2010-01-08 the WG decided to accept the suggested changes to the stylesheets, with a request to Sandy Gao to insert these changes into the status quo.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37448</commentid>
    <comment_count>2</comment_count>
      <attachid>907</attachid>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2010-08-16 17:11:39 +0000</bug_when>
    <thetext>Created attachment 907
revised stylesheet for chameleon include

Attached is the revised form of the stylesheet, which is included in the new status-quo document at 

  http://www.w3.org/XML/Group/2004/06/xmlschema-1/structures.html#chameleon-xslt
  (member-only link)

I believe this resolves the issue, so I&apos;m marking the issue RESOLVED.

As the originator, Hans-Jürgen Rennau is invited to check that the corrections have been made correctly (it&apos;s always easy to mess something up) and indicate by either closing or reopening the issue that  he is satisfied, or not satisfied, with the resolution of the issue.  If the WG does not hear from you in the next two weeks or so, we will assume that you are satisfied.  

Thank you very much for catching the errors, and for providing the fixes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37626</commentid>
    <comment_count>3</comment_count>
    <who name="Hans-Juergen Rennau">hrennau</who>
    <bug_when>2010-08-18 20:04:49 +0000</bug_when>
    <thetext>(In reply to comment #2)
Thank you, everything looks fine, I close the issue.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>907</attachid>
            <date>2010-08-16 17:11:39 +0000</date>
            <delta_ts>2010-08-16 17:11:39 +0000</delta_ts>
            <desc>revised stylesheet for chameleon include</desc>
            <filename>chameleon.newsq.xsl</filename>
            <type>application/xml</type>
            <size>2400</size>
            <attacher name="C. M. Sperberg-McQueen">cmsmcq</attacher>
            
              <data encoding="base64">PHhzbDp0cmFuc2Zvcm0gdmVyc2lvbj0iMi4wIgogICAgICAgICAgICAgICB4bWxuczp4c2w9Imh0
dHA6Ly93d3cudzMub3JnLzE5OTkvWFNML1RyYW5zZm9ybSIKICAgICAgICAgICAgICAgeG1sbnM6
eHM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hIgogICAgICAgICAgICAgICB4bWxu
czpmPSJodHRwOi8vd3d3LnczLm9yZy8yMDA4LzA1L1hNTFNjaGVtYS1taXNjIj4KCiAgPHhzbDpw
YXJhbSBuYW1lPSJuZXdUYXJnZXROYW1lc3BhY2UiIGFzPSJ4czphbnlVUkkiIAogICAgICByZXF1
aXJlZD0ieWVzIi8+CiAgPHhzbDpwYXJhbSBuYW1lPSJwcmVmaXhGb3JUYXJnZXROYW1lc3BhY2Ui
IGFzPSJ4czpOQ05hbWUiIAogICAgICBzZWxlY3Q9ImY6Z2VuZXJhdGVVbmlxdWVQcmVmaXgoLiwg
MCkiLz4KCiAgPHhzbDp0ZW1wbGF0ZSBtYXRjaD0iQCp8bm9kZSgpIj4KICAgIDx4c2w6Y29weT48
eHNsOmFwcGx5LXRlbXBsYXRlcyBzZWxlY3Q9IkAqfG5vZGUoKSIvPjwveHNsOmNvcHk+CiAgPC94
c2w6dGVtcGxhdGU+CgogIDx4c2w6dGVtcGxhdGUgbWF0Y2g9InhzOnNjaGVtYSI+CiAgICA8eHNs
OmNvcHk+CiAgICAgPHhzbDpuYW1lc3BhY2UgbmFtZT0ieyRwcmVmaXhGb3JUYXJnZXROYW1lc3Bh
Y2V9IiAKICAgICAgIHNlbGVjdD0iJG5ld1RhcmdldE5hbWVzcGFjZSIvPgogICAgIDx4c2w6YXBw
bHktdGVtcGxhdGVzIHNlbGVjdD0iQCoiLz4KICAgICA8eHNsOmF0dHJpYnV0ZSBuYW1lPSJ0YXJn
ZXROYW1lc3BhY2UiIAogICAgIC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Rpb24+Cgo8L3hzbDp0cmFu
c2Zvcm0+
</data>

          </attachment>
      

    </bug>

</bugzilla>