Porthos wrote:
I've been working on mining data from a schema file (all attribute
data so far) and have come to the point where I need to get information
that is contained in tags. For instance, <tag>My Data Here</tag>.
I've tried using the <xsl:value-of select="tag"/> element, but it does
not appear to work in schema files. Is this correct? Is there another
way to get at this data?
A W3C XML schema is XML and can therefore certainly be processed by a
W3C XSLT stylesheet and there you can use
<xsl:value-of select="elementname" />
to get the string value of an element with name 'elementname'.
It is not clear to me what you are asking about, do you have a W3C XML
schema and want to process that with an XSLT stylesheet? Inside of such
a schema an element is defined as follows e.g.
<xs:element name="elementname" type="xs:string" />
so an XSLT stylesheet could then go and read out
<xsl:value-of
xmlns:xs="http://www.w3.org/2001/XMLSchema"
select="xs:element/@name" />
If the element has complex content then its declaration looks like e.g.
<xs:element name="elementname">
<xs:complexType>
<xs:sequence>
<xs:element name="element2name" />
</xs:sequence>
</xs:complexType>
</xs:element>
then of course a stylesheet trying to process that needs to make sure it
processes subelements like complexType or sequence.
But as I am not sure what you are looking for it is not possible to give
a concrete example.
--
Martin Honnen
http://JavaScript.FAQTs.com/