Guest Ann Posted September 6, 2006 Posted September 6, 2006 Hi I wanna convert xml file like <html> <body> <h1>Chapter 1</h1> <p>Then with expanded wings he steers his flight</p> <p>Aloft, incumbent on the dusky Air</p> <h2>Chapter 1, Section 1</h2> <p>That felt unusual weight, till on dry Land</p> <p>He lights, if it were Land that ever burned</p> </body></html> to a new xml format file <chapter> <section> <title>Chapter 1</title> <para>Then with expanded wings he steers his flight</para> <para author="ar">Aloft, incumbent on the dusky Air</para> </section> <section><title>Chapter 1, Section 1</title> <para>That felt unusual weight, till on dry Land</para> <para>He lights, if it were Land that ever burned</para> </section></chapter> I have tried several ways, but all failed. Does anyone could help me, or give me some suggestion. Thanks.
boen_robot Posted September 6, 2006 Posted September 6, 2006 Well, you don't have anything complicated, so the easiest thing to do is simple mapping: <xsl:template match="oldElementName"><newElementName><xsl:apply-templates/></newElementName></xsl:template> However, I don't understand how would you know the author of the second para? I mean it isn't written anywhere in the input.
kvnmck18 Posted October 3, 2006 Posted October 3, 2006 Are you trying to make an XML of U.S Constitution. haha
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now