Click here to Skip to main content
15,918,889 members
Home / Discussions / XML / XSL
   

XML / XSL

 
GeneralRe: How to format this date? Pin
Christian Graus16-Jun-05 14:36
protectorChristian Graus16-Jun-05 14:36 
GeneralHelp how to show this xml file in dataGrid Pin
manojsoni_dims16-Jun-05 2:50
manojsoni_dims16-Jun-05 2:50 
GeneralHelp I can't show the XML IN DATAGRID Pin
manojsoni_dims16-Jun-05 2:43
manojsoni_dims16-Jun-05 2:43 
GeneralMSXML2::IXMLDOMDocument::save a xml doc Pin
Saurabh_Delhi13-Jun-05 17:24
Saurabh_Delhi13-Jun-05 17:24 
GeneralXML > Dataset. Please, I need help. Thank You. Pin
shapper13-Jun-05 13:21
shapper13-Jun-05 13:21 
QuestionHow to get nodes and place data into dataset? Pin
shapper13-Jun-05 8:04
shapper13-Jun-05 8:04 
GeneralLittle Problem in XML and ASP based project Pin
eshban28410-Jun-05 9:39
eshban28410-Jun-05 9:39 
GeneralPlease Help: XSLT transformation problem with namespaces Pin
Member 169700910-Jun-05 8:32
Member 169700910-Jun-05 8:32 
Hi!

I'm trying to convert a simple XML file into HTML using an XSLT file but I'm lost with namespaces. Can anyone help please?

XML File:
<?xml version="1.0" encoding="utf-8"?>
<PCFiles>
<File>
<FileName>Clients</FileName>
<FileDescShort>This is the short description</FileDescShort>
</File>
</PCFiles>

XSLT:
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<h2><xsl:value-of select="PCFiles/File/FileName"/></h2>
</xsl:template>
</xsl:stylesheet>

At this point, everything works fine. The result of the convertion is "<h2>Clients</h2>".

My problem is that I use VisualStudio 2003 and use a SCHEMA to build the XML file.

XSD:
<?xml version="1.0" ?>
<xs:schema id="PCFiles" targetNamespace="http://cablysuni/namespace" xmlns:mstns="http://cablysuni/namespace"
xmlns="http://cablysuni/namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:element name="PCFiles" msdata:IsDataSet="true" msdata:Locale="en-CA" msdata:EnforceConstraints="False">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="File">
<xs:complexType>
<xs:sequence>
<xs:element name="FileName" msdata:Caption="** File Name **" type="xs:string" minOccurs="0" />
<xs:element name="FileDescShort" msdata:Caption="** Short Description **" type="xs:string" minOccurs="0" />
<xs:element name="FileExt" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>

The problem is that when linking the XML file to the Schema, the XML file becomes:
<PCFiles xmlns="http://cablysuni/namespace">
...
</PCFiles>

At that point, the conversion doesn't work anymore. I have tried to add the schema in the XSLT file as well, I tried prefixes, I just can't get this to work.

Could someone help me out here? Could you post exactly what I would need to add in the XSLT file to make this work? Do I have to use schema locations? The XML file works fine in a .NET project but I suspect the Schema cannot be loaded otherwise. I'm lost with all this. Where should the schema be, how can I make the XML point to a specific location, etc.

Thank you all for the help! I really need to make this XSLT work.

Fred


Frederick Ouimet
frederick.ouimet@infocablys.com
GeneralRe: Please Help: XSLT transformation problem with namespaces Pin
DavidNohejl10-Jun-05 9:02
DavidNohejl10-Jun-05 9:02 
GeneralGet XmlSchemaElement from XmlSchema by ID Pin
El'Cachubrey9-Jun-05 23:18
El'Cachubrey9-Jun-05 23:18 
QuestionWhy this error when using XML data? Pin
shapper9-Jun-05 15:43
shapper9-Jun-05 15:43 
AnswerRe: Why this error when using XML data? Pin
shapper9-Jun-05 15:44
shapper9-Jun-05 15:44 
AnswerRe: Why this error when using XML data? Pin
Christian Graus9-Jun-05 15:47
protectorChristian Graus9-Jun-05 15:47 
QuestionImplementation of XML (.NET 1.1) and RemoveChild() - is it a bug ? Pin
lkrzanik9-Jun-05 5:27
lkrzanik9-Jun-05 5:27 
QuestionXML and ASP.NET. How to set this? Pin
shapper9-Jun-05 5:03
shapper9-Jun-05 5:03 
GeneralWhats wrong with this code Pin
Usman Tasleem Akshaf8-Jun-05 20:04
Usman Tasleem Akshaf8-Jun-05 20:04 
GeneralRe: Whats wrong with this code Pin
Christian Graus9-Jun-05 15:54
protectorChristian Graus9-Jun-05 15:54 
GeneralRe: Whats wrong with this code Pin
KaptinKrunch13-Jun-05 19:27
KaptinKrunch13-Jun-05 19:27 
GeneralRename Element(TagName) in DOM Pin
Fastfootskater7-Jun-05 21:41
Fastfootskater7-Jun-05 21:41 
GeneralRe: Rename Element(TagName) in DOM Pin
Fastfootskater8-Jun-05 1:56
Fastfootskater8-Jun-05 1:56 
Generalconvert xml file to excel file by using vb6 Pin
YETER737-Jun-05 20:30
YETER737-Jun-05 20:30 
GeneralUsing XML Schemas in C++ Unmanaged Code Pin
RFickling7-Jun-05 16:39
RFickling7-Jun-05 16:39 
GeneralConvert XML/XSL to Image File Pin
pfsarff7-Jun-05 10:55
pfsarff7-Jun-05 10:55 
GeneralRe: Convert XML/XSL to Image File Pin
DavidNohejl7-Jun-05 11:41
DavidNohejl7-Jun-05 11:41 
GeneralRe: Convert XML/XSL to Image File Pin
pfsarff8-Jun-05 4:27
pfsarff8-Jun-05 4:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.