开发者

Display XML in proper formatted way [closed]

开发者_Go百科 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 9 years ago.

Is there any way to show XML data in a good and readable format using PHP? I know I can build code to do this, but is there a function that does something similar I can reuse?

eg:

<animals><animal><name>Lion</name><type>Stay away</type></animal><animal><name>Koala Bear</name><type>Hug</type></animal></animals>

Is there some code that will show me the data in a decent format? eg:

Animal
  Name - Lion
  Type - Stay Away
Animal
  Name - Koala Bear
  Type - Hug

Some kind of XML to HTML display?


Yes it is called XSLT and there is a XSL class in PHP.

With XSLT you can transform XML documents basically to any kind of output.


It is called XSLT, you can transform XML into anything. link text

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜