XSLT stylesheet of type text/xml not recognized; type text/xsl is recognized

VERIFIED FIXED in mozilla0.9.6

Status

()

P3
normal
VERIFIED FIXED
17 years ago
17 years ago

People

(Reporter: brandon, Assigned: peterv)

Tracking

Trunk
mozilla0.9.6
x86
Windows 98
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

17 years ago
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.5) Gecko/20011011
BuildID:    2001101117

The XSLT stylesheet http://www.1122productions.com/brandon/xml/songlist.xsl is
not applied to the XML file.  This file should be applied in the processing
instruction <?xml-stylesheet href="songlist.xsl" type="text/xml"?>.  However,
the processing instruction <?xml-stylesheet href="songlist.xsl"
type="text/xsl"?> does seem to work, as shown on
http://www.1122productions.com/brandon/xml/a-text-xsl.xml.

The type text/xml is supposed to be the standard, I think.

Reproducible: Always
Steps to Reproduce:
1. Go to http://www.1122productions.com/brandon/xml/a-text-xml.xml


Actual Results:  The XSLT stylesheet
http://www.1122productions.com/brandon/xml/songlist.xsl is not applied to the file.

Expected Results:  The stylesheet should be applied, with the results looking
like http://www.1122productions.com/brandon/xml/a-text-xsl.xml.

In addition, the title tag does not work in the template in songlist.xsl; the
text should match the h1 tag that does appear.  I can file another bug for this
if desired.

<xsl:template match="Songlist">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Fight Songs: <xsl:value-of select="@letter"/></title>
</head>
<body>
<h1>Fight Songs: <xsl:value-of select="@letter"/></h1>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
Status: UNCONFIRMED → NEW
Ever confirmed: true
Peter, didn't you fix this already?
Assignee: heikki → kvisco
Component: XML → XSLT
QA Contact: petersen → kvisco
(Assignee)

Comment 2

17 years ago
This fails because we pass text/xml to nsTransformMediator::Init
(http://lxr.mozilla.org/seamonkey/source/content/xsl/document/src/nsTransformMediator.cpp#75).
 Two ways to fix this, add the categories for text/xml and application/xml or
hardcode the contract id with text/xsl.
Transformiix could register itself with the different categories but as they are
the same, maybe we should hardcode it. Heikki, what do you think would be best?
Assignee: kvisco → peterv
Priority: -- → P3
Target Milestone: --- → mozilla0.9.6
(Assignee)

Updated

17 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 4

17 years ago
Looking for reviews.
Ouch, this seems horrible. NS_ConvertASCIItoUCS2(kXSLType) makes a new string
class !

+  if ((Compare(aType, NS_ConvertASCIItoUCS2(kXSLType),
+               nsCaseInsensitiveStringComparator()) == 0) ||
+      (Compare(aType, NS_ConvertASCIItoUCS2(kXMLTextContentType),
+               nsCaseInsensitiveStringComparator()) == 0) ||
+      (Compare(aType, NS_ConvertASCIItoUCS2(kXMLApplicationContentType),
+               nsCaseInsensitiveStringComparator()) == 0)) {

How about aType.EqualsIgnoreCase(kXSLType) etc.

Comment 6

17 years ago
Comment on attachment 55989 [details] [diff] [review]
Fix v1

Global suggestions:

I guess I prefer |const nsAString&| over |const nsAReadableString&|.

Instead of #include'ing nsAReadableString.h, #include nsAString.h or nsString.h

I guess you should use .EqualsIgnoreCase or .EqualsWithConversion with the case parameter specified instead of these |Compare|s, till we have a way to do the same with |Compare|.

-  if (nsnull == it) {
+  if (it) {
     return NS_ERROR_OUT_OF_MEMORY;

I'm sure you meant:

  |if (!it)|

+    mTransformer = do_CreateInstance(contractID, &rv);

keep the |.get()| there, do_CreateInstance takes a const char*, not a nsCString, and I'm in the process of removing the implicit conversion.
(Assignee)

Updated

17 years ago
Attachment #55989 - Attachment is obsolete: true
Comment on attachment 56117 [details] [diff] [review]
v2

sr=jst
Attachment #56117 - Flags: superreview+
(Assignee)

Comment 10

17 years ago
Really fixed now.
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED

Comment 11

17 years ago
we didn't verify for a long time.
I really checked, so VERIFIED.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.