So I have a XML file that contains a lot of data. My task is to extract the 'name' and 'description' information from the XML file so it reads out. I have been messing with it for a while, and I got half way there.
The way the data that I need to extract in the XML file looks like is
<name> Some Name</name>
and the data that is in the description is
<description> The Description </description>
What I have done is extract all the description to a text file, but I know I am doing this the hard/not efficient way. Any ideas?
Also, if I could add some detail to help describe what I am doing, I can do so! Hopefully I described it efficiently though.
Based on comments in question, create a C# application which uses XPath to extract the nodes you are interested in.
A good tutorial to follow:
http://support.microsoft.com/kb/308333
Related
currently when working with mpxj library, generated task xml will have following attributes
<Task>
<UID>0</UID>
<ID>0</ID>
<Name>Naruto Uzumaki</Name>
<Active>1</Active>
<Manual>0</Manual>
......
......
</Task>
I do not want Active and Manual tags present in the generated xml, is there any way to achieve this? Kindly help.
Thanks in Advance.
I'm not sure of MS Project's behaviour if these values are removed entirely... if it would give you the defaults you are expecting when it reads the file. On that basis it is not something you can change in MPXJ itself.
However, one simple way to achieve what you want would be to apply an XSL transformation to the generated XML to remove the elements you don't want. The answer to this StackOverflow question provides an example of how this could be done.
Assuming you are using Java and you are writing to a stream you can probably use one of the mechanisms highlighted in this StackOverflow question to take the output directly from MPXJ and pass it through an XSL transformation.
Does anybody knows how to create a structured report using dicom scope toolkit via console (ubuntu 16.04) with a link to a related image?
The thing is that I have an image of some kind of trauma and I have to connect with a report which is in a text file. The last file should be in .dcm format which contains annotation and a link to an image. I have to use dicom scope program.
Maybe others refrain from answering because your question needs a very long answer. I cannot provide step-by-step instructions, a few hints, though.
The way I would go is to:
(assuming that your image is available in DICOM format):
obtain a sample structured report. I think that the "simple" Basic Text SR is what you want to go for. You can find some samples here.
convert the SR to an XML file using dsr2xml
edit the contents in XML. Do not forget to include your image reference in (0040,a730) Content Sequence -> (0008,1199) Referenced SOP Sequence
convert the XML back to DICOM SR using xml2dsr
By the way: From your question, I did not really understand why you want to use a structured report, as you wrote that your report is plain text. Instead of digging into the complex structure of SR, you may want to consider exporting the report to an Encapsulated PDF document which can reference images as well.
I want to write a java program, Input - XSD File I need to retreive all the element name from the xsd and need to create an xml file as an output with the retreived element name. If anyone of you have the sample code, please share it.
Thanks
You are not rephrasing your question,but still i found some suggestions for you.See if its useful for you.Please check the following link...
http://www.narendranaidu.com/2010/04/xsd-to-xml-and-vice-versa.html
Alright use JAXME or XSOM to parse your schema and use DOM or JDOM to write the element names to new xml
if you want to create a sample XML from schema ..you can use XMLspear tool to do that.
http://www.donkeydevelopment.com/
I have two XSD files (source and target)... on what basis should I map these two files to get an XSLT? I know how MapForce helps in mapping but I worked with the sample project ..Now I wanted to know on what basis should I map these file that my client sent me..
I don't think there could be any general way to generate an XSLT given two XSD (if this is what your are after). The XSDs describe the structure of the XML files, but they don't say anything about what is the data they contain (their semantics if you will).
E.g.
<Customer>
<Name>ACME</Name>
<Address>9 Main Street, Anytown, USA</Address>
</Customer>
and
<Customer Name="ACME" City="Anytown" Country="USA" Address="9 Main Street"/>
are two XML describing more or less the same thing - but there is no way to know reading their XSD that the <Address> element in one correspond to three different attributes Address, City and Country in the other.
I am afraid you have to create the XSLT manually - and my suggestion would be to start from sample XML files, not the XSDs - much easier.
am afraid you have to create the XSLT manually - and my suggestion would be to start from sample XML files, not the XSDs - much easier.
I'm creating an excel-sheets that reads the tags from the MP3-files situated in a folder. Yet the time apparently is or calculated from data inside the MetaProperties of a file or is inside those data. When I use the Property MetaProperties VBA always provokes an error, even in using a copy of the example in adapting the appropiate data. Thanx in advance for your solution.
Does this help?
http://technet.microsoft.com/en-us/library/ee176591.aspx
You didn't say what metadata you want, but this method offers a lot of information.
MP3's do not use MetaProperties at all. They actually use the last 256 bytes of the file to store album, track, etc information (the ID3 tag).
See here http://id3.org/id3v2.4.0-structure for more information.