Jump to content

Transofrming a per new DTD


Guest veena_barretto

Recommended Posts

Guest veena_barretto

Hello, Can we use xslt to transform one xml to another as per a DTD.By this i mean... can we rearrange the tags from the old xml to new xml as per the order in the DTD. ???Also im doing something like <xsl:if test="count(select ="@n='hello'")"/>this gives me error , i tired this <xsl:if test="count(select ='@n='hello' ')"/> this also gives error, How can we call select within another function (like name or count or string-length) ??

Link to comment
Share on other sites

I think a DTD and schema could be transformed scince they are XML documents by nature.count() is an XPath function which returns the number of the nodes inside it. What you have done gives errors for 2 reasons:1. There isn't anything to do after the counting. Imagine that the result of the counting is 3. Then the test would look like test="3". This isn't a true conditional expression.2. The argument inside the count() is not valid. You must specify the different items. Like "count(item1,item2)".

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...