Remove From My Forums. Answered by:. Archived Forums. XML, System. Sign in to vote. Hi all, I am sorry if this is a duplicate, but I did not get a response from the other forum I posted this in I call a web service that returns a block of XML which then gets given an. The XML that comes back from the suppliers web service is also stored in the database.
What I want to do is be able to re-apply this. If I pull the XML from the database and save it into a. Is there an easy way to do this? Or do I need to use specific software? Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. NET example?
Ask Question. Asked 10 years, 8 months ago. Active 10 years, 8 months ago. Viewed 4k times. Thank you. Improve this question. Have you looked at any of the many tutorials that cover this, such as msdn. When posting questions on SO you should first make an effort to answer them yourself, and then bring up specific questions on what you've tried.
The labels marked up in the content are such that the meaning of the content can be interpreted according to how the labels are documented to be used. To assist with this, namespaces can help tremendously in differentiating these labels from those used in other XML vocabularies. XML document translation is required when the labels that you need are different than the labels that you have.
When displaying your content in a web browser, HTML has its own set of labels interpreted by the browser with semantics to present the information. When displaying your content on paper, the Extensible Stylesheet Language Formatting Objects XSL-FO has its own set of labels interpreted by a composition engine as having semantics to produce print images. As well, you may be transforming your XML information to the same target vocabulary in more ways than one because you have different audiences that perceive your information differently.
Different transformations are needed for the different audiences, and those differences may be subtle or may be extensive. That is, you need to express how to create a new labeled tree of your information from your existing labeled tree of your information. You may be tempted to continue using your own favourite language and library to express the transformation. Such languages using the Document Object Model DOM offer the logic to change the parts of your document in place and then serialize the tree as output.
Alternatively one can use the library to access the information and simply write out the document using program logic, though that really isn't very simple. Taking the responsibility to create the output XML syntax and proper Unicode encodings can be a burden on programmers, not even considering the risk that such is done improperly. It takes in well-formed XML syntax and it produces well-formed XML syntax without the programmer having to worry about the variations possible for either.
More on this later. As its name implies, XSLT is extensible in a standard fashion to access non-standard functionality. Vendors can offer non-standardized functionality such as for data projection, for unique collation algorithms and for custom functions, but in a way that a conforming XSLT processor can gracefully handle unrecognized functionality in a standardized fashion.
The same data model is used by both. Many vendors offer a single transformation engine that runs both kinds of transformation expression. The same output serialization specification is used by both languages. Moreover, the primary mindset and writing styles when comparing XSLT expressions stylesheets and XQuery expressions are very different. Such differences are critical to writing quality XSLT stylesheets and may impact your team's performance based on their experience in programming approaches.
Most programming languages are written primarily in an imperative style. The logic starts at the top of the program code and works its way down to the end of the code, producing output along the way. There are function calls that jump out to other modules, and inclusion directives that pull in other bits of code into the main block of code, but one typically starts and the beginning and goes to the end. JavaScript, C and Python are but a few examples of imperative programming languages. XQuery is also such an imperative language.
The XQuery expression itself is structured along the lines of the output document organization. Not so with XSLT, which is, at its heart, a declarative programming language. The features and power XSLT brings to the table for transformation are best utilized in the declarative style.
It is possible one could declare a single XSLT handler called a "template" for all content to be triggered by a single event, and write that one handler in the imperative style, and imperative programmers would no doubt find that the easiest way to use XSLT. But that isn't the best way to use XSLT. Programmers need to be skilled in conceiving and establishing granular declarative handling while at the same time finessing event generation to be handled in such a way as to produce the output.
Granted, using callbacks in imperative languages is an example of a declarative programming style. But in most programming languages this is a contrivance built on top of the imperative model. It is this fundamental difference in the approach to writing stylesheets that separates a good XSLT programmer from a programmer that hacks his way to getting the correct result while using XSLT. While getting the correct result is the end game, writing XSLT well creates a solution that can be leveraged into other solutions and can be maintained with more assurance of reducing the introduction of faults into working code.
Writing XSLT well takes practice and requires the skilled programmer to engage a mindset quite different from that required when writing in traditional imperative languages. These points are illustrated later. After decades of different intelligence organizations producing drastically differently-appearing intelligence reports, the US intelligence community has agreed upon a single XML vocabulary used by agents to record information.
In the project, the organizations wanted to continue seeing the information in their own individual style where only low-level constructs such as sections, paragraphs, tables, graphics, etc. The overall renderings, such as title pages, tables of content and layout constraints are very different.
The declarative style in XSLT is ideal for creating a single solution with overriding components. Declared components that are not overridden render the portions of content the same across all documents. Declared components that are overridden for each organization render the portions of content that are different. Designing from the bottom up in the declarative style created a solution easily leveraged as required across multiple installations. Seasoned developers using traditional programming languages must also appreciate that the data and processing models underlying XSLT are different from what they have been dealing with.
No doubt programmers are well used to considering the syntax of the files that are input to a program, the syntax of the files that are output from a program, and the steps in their program to create output syntax from input syntax. Relying on such a traditional approach can hinder a programmer's perspective of XSLT and prevent one from properly understanding that the writing and processing of an XSLT stylesheet is entirely divorced from the syntax of the input and output files.
Here is the equivalent code for processing an XML file on the server. The code here is essentially the same as that for the client side, with the same error formatting functions and processing. The Server. CreateObject and Response. Write methods are used in place of the client-side functions provided by data islands and the innerHTML method. Skip to main content.
0コメント