Affichage des articles dont le libellé est Active questions tagged xml - Stack Overflow. Afficher tous les articles
Affichage des articles dont le libellé est Active questions tagged xml - Stack Overflow. Afficher tous les articles

mercredi 6 mai 2015

How can I create dynamic objects in VBA for creating MSXML

I am looking for a less verbose way of creating hierarchical repeating XML with VBA and MSXML. At the moment I have a spreadsheet that lays out my XML levels like so

Intro Level 1 - Exam Section Level 2 - Exam Section Level 2 - Exam Section Level 2 - Exam Section Level 2 - Exam Section Level 1 - Exam Section Level 2 - Exam Section Level 2 - Exam Section Exit

This is a variant in VBA and the order is maintained

I have the following code that works fine - the Intro and Exit creation are fine as they are different to the section node. But the section node has repeating factors - rather than using the if logic of what level am I at and doing 5 times the same code (making it a nightmare to maintain) - is there a simpler way for me to iterate the levels and add to the parent.

We can assume that the if there is a level1 and then a level2 the parent of that level 2 would be the preceding level1

'loop the sections to add to dom structure - this uses a range in the spreadsheet called ExamSections
    For i = LBound(varExamSections) To UBound(varExamSections)

    'dont add blank values from the spreadsheet
        If varExamSections(i, 1) <> "" Then

            If varExamSections(i, 1) = "Intro" Then

                'add intro section element
                Set introSection = dom.createElement("section")
                assessment.appendChild introSection
                introSection.setAttribute "ident", varExamSections(i, 2)

                'add intro section proc extension
                Set sectionprocExtension = dom.createElement("sectionproc_extension")
                introSection.appendChild sectionprocExtension

                'add intro section control
                Set SectionControl = dom.createElement("sectioncontrol")
                sectionprocExtension.appendChild SectionControl
                SectionControl.setAttribute "end_assessment", "false"

            End If

            If varExamSections(i, 1) = "Level 1 - Exam Section" Then

                'add level section element
                Set sectionLvl1 = dom.createElement("section")
                assessment.appendChild sectionLvl1
                sectionLvl1.setAttribute "ident", varExamSections(i, 2)

                If varExamSections(i, 3) <> "" Then
                    sectionLvl1.setAttribute "title", varExamSections(i, 3)
                End If


            End If

            If varExamSections(i, 1) = "Level 2 - Exam Section" Then

                'add level section element
                Set sectionLvl2 = dom.createElement("section")
                sectionLvl1.appendChild sectionLvl2
                sectionLvl2.setAttribute "ident", varExamSections(i, 2)

                If varExamSections(i, 3) <> "" Then
                    sectionLvl2.setAttribute "title", varExamSections(i, 3)
                End If


            End If

            If varExamSections(i, 1) = "Level 3 - Exam Section" Then

                'add level section element
                Set sectionLvl3 = dom.createElement("section")
                sectionLvl2.appendChild sectionLvl3

                sectionLvl3.setAttribute "ident", varExamSections(i, 2)

                If varExamSections(i, 3) <> "" Then
                    sectionLvl3.setAttribute "title", varExamSections(i, 3)
                End If

            End If

            If varExamSections(i, 1) = "Level 4 - Exam Section" Then

                'add level section element
                Set sectionLvl4 = dom.createElement("section")
                sectionLvl3.appendChild sectionLvl4

                sectionLvl4.setAttribute "ident", varExamSections(i, 2)

                If varExamSections(i, 3) <> "" Then
                    sectionLvl4.setAttribute "title", varExamSections(i, 3)
                End If


            End If

            If varExamSections(i, 1) = "Level 5 - Exam Section" Then

                'add level section element
                Set sectionLvl5 = dom.createElement("section")
                sectionLvl4.appendChild sectionLvl5

                sectionLvl5.setAttribute "ident", varExamSections(i, 2)

                If varExamSections(i, 3) <> "" Then
                    sectionLvl5.setAttribute "title", varExamSections(i, 3)
                End If

            End If

            If varExamSections(i, 1) = "Exit" Then

                'add level section element
                Set sectionExit = dom.createElement("section")
                assessment.appendChild sectionExit

            End If


            'exam_reporting_groupref.setAttribute "linkrefid", varReportingGroups(i, 2)

        End If

    Next i

Any help would be greatly appreciated.

Convert list of all folders and subfolders of unit c:\ to an XML file in c#

I want to make a small program in C # that allows to load a list with the path of all folders and subfolders of any unit, eg "C: \", to an XML or any other file type. The goal is that after this, the file will serve to another program that I have to do a search and open particular folder.

It is possible to do this?

Thanks,

Fusioncharts XT Hovereffect only works on the half chart

I've got a Multi-Series Chart, which only shows animation on the left side of the chart. The showTooltip works well, as long it's on the left side but when you move over the anchors on the right side, it doesn't work.

Does anyone know this error?

repeat rows for multiple groupitem xslt 2.0

I want to achieve this in xslt 2.0. For same company the actor should repeat. And if they have multiple attributes e.g University Name then it should be comma separate.

CompanyName Location City Profession Name University

ABC Mumbai Mumbai Actor Harry Potter Delhi, Mumbai ABC Mumbai Mumbai Actor Wilma Smith Mumbai XYZ Viman Pune Doctor Ajay Singh Pune

Please suggest me xslt `

how to find out '<' character which is not a markup tag in xml string using java?

The below xml is converted into a String.I have to find '<' character which is part of xml element actionComent value

<actionTakenTaskCollectionRoot>
  <actionTakenTask actionTakenTaskId="8a8080844cd55b0b014cd5f783ea0692">
    <actionComment>a **<** b</actionComment>
  </actionTakenTask>
</actionTakenTaskCollectionRoot>

How to use BI Reporting Tools

I have just now deployed a SpagoBI server / Studio and want to generate some reports with charts with MS SQL Server as my backend database.

I was told that we need to create an XML for our query in database. I am not sure how to do that as it is my very first time.

Kindly guide.

XSLT infinite template recursion in PHP

I am using the XSLT processor available in PHP to transform an XML file. When my XML file is a sample file everything is ok but when I try to process a file with something like 1000 lines I have this error:

Warning: XSLTProcessor::transformToXml(): xsltApplyXSLTTemplate: A potential infinite template recursion was detected. You can adjust xsltMaxDepth (--maxdepth) in order to raise the maximum number of nested template calls and variables/params (currently set to 3000)

My xml file looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<TEI xmlns="http://ift.tt/1dDT9n4">
  <teiHeader xml:lang="en" />
  <text>
    <body>
      <div type="chapter" n="1">
        <p>
          <s xml:id="e_1">In my younger and more vulnerable years my father gave me some advice that I've been turning over in my mind ever since.</s>         
        </p>
        <p>
          <s xml:id="e_2">"Whenever you feel like criticizing any one," he told me, "just remember that all the people in this world haven't had the advantages that you've had."</s>
        </p>
        </body>
  </text>
</TEI>

and my XSLT treatment is:

<xsl:stylesheet version="1.0" 
xmlns:xsl="http://ift.tt/tCZ8VR" 
xmlns:exsl="http://exslt.org/common"
xmlns:set="http://exslt.org/sets"
xmlns:tei="http://ift.tt/1dDT9n4"
extension-element-prefixes="exsl set">
<xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>
<xsl:strip-space elements="*"/>

<!-- identity transform -->
<xsl:template match="@*|node()">
    <xsl:copy>
        <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
</xsl:template>

<xsl:template match="tei:div">
    <xsl:call-template name="split-chapter">
        <xsl:with-param name="nodes" select="tei:p/tei:s"/>
    </xsl:call-template>
</xsl:template>

<xsl:template name="split-chapter">
    <xsl:param name="nodes"/>
    <xsl:param name="limit" select="300"/>
    <xsl:param name="remaining-nodes" select="dummy-node"/>
    <!-- 1. Calculate the total length of nodes -->
    <xsl:variable name="lengths">
        <xsl:for-each select="$nodes">
            <length>
                <xsl:value-of select="string-length()" />
            </length>
        </xsl:for-each>
    </xsl:variable>
    <xsl:variable name="total-length" select="sum(exsl:node-set($lengths)/length)" />
    <!-- 2. Process the chapter: -->
    <xsl:choose>
        <!-- If chapter is too long and can be shortened ... -->
        <xsl:when test="$total-length > $limit and count($nodes) > 1">
            <!-- ... try again with one node less. -->
            <xsl:call-template name="split-chapter">
                <xsl:with-param name="nodes" select="$nodes[not(position()=last())]"/>
                <xsl:with-param name="remaining-nodes" select="$remaining-nodes | $nodes[last()]"/>
            </xsl:call-template>
        </xsl:when>
        <xsl:otherwise>
            <!-- Otherwise create a chapter with the current nodes ... -->
            <div type="chapter" n="{@n}" length="{$total-length}" >
                <!-- ... list the paras participating in this chapter ... -->
                <xsl:for-each select="$nodes/parent::tei:p">
                    <p>
                        <!-- ... and process the nodes still left in each para. -->
                        <xsl:apply-templates select="set:intersection(tei:s, $nodes)"/>
                    </p>
                </xsl:for-each>
            </div>
            <!-- Then process any remaining nodes. -->
            <xsl:if test="$remaining-nodes">
                <xsl:call-template name="split-chapter">
                    <xsl:with-param name="nodes" select="$remaining-nodes"/>
                </xsl:call-template>
            </xsl:if>
        </xsl:otherwise>
    </xsl:choose>
</xsl:template>

</xsl:stylesheet>

How to create a XML file with the default format

I'm beginner in XML and I have this informations

box1 -> name, colour, from

box2 -> name, weight

box3 -> name, colour, from, weight

and I want to make one XML file like this:

<boxName>name1
    <boxColour>colour1</boxColour>
    <boxFrom>from1</boxFrom>
</boxName>
<boxName>name2
    <boxColour>colour2</boxColour>
    <boxWeight>weight2</boxWeight>
</boxName>
<boxName>name3
    <boxColour>colour3</boxColour>
    <boxFrom>from3</boxFrom>
    <boxWeight>weight3</boxWeight>
</boxName>

I created my XML in this form:

TiXmlDocument doc;
TiXmlDeclaration* decl = new TiXmlDeclaration("1.0", "utf-8", "");
doc.LinkEndChild( decl );
TiXmlElement* element = new TiXmlElement("boxName");
doc.LinkEndChild(element);
TiXmlText* text = new TiXmlText("name1");
element->LinkEndChild(text);
TiXmlElement* element2 = new TiXmlElement("boxColour");
TiXmlElement* element3 = new TiXmlElement("boxFrom");
TiXmlText* text2 = new TiXmlText("colour1");
TiXmlText* text3 = new TiXmlText(from1);
element->LinkEndChild(element2);
element->LinkEndChild(element3);
element2->LinkEndChild(text2);
element3->LinkEndChild(text3);
doc.SaveFile( "XML.xml" );

but the problem is that number of boxes is unknown and each box my have 1,2,3 or more child, but the format for each box and it's information is the same (as the above)

please help me to make the XML file

Thanks

upgrade winform application not overwriting XML file even when "Always Copy"

I have an winform application say StackOverflow.exe. When I upgrade the latest release from StackOverflow.exe version 1.1 to version 1.2, its not overwriting XML file(say plugin.xml) from output content folder.

Note: plugin.xml is overwriten everytime i close StackOverflow.exe.

Aitoc layered anvigation in 1-column layout

I want to include Aitoc layered navigation pro to my 1-column layout on my magento site. I've been successful in adding the normal layered navigation by inserting this line of code in the content block catalog.xml

I thought that this would be enough to include the layered navigation pro, but this doesn't seem to be the case. Does anyone know how I can include this?

I am little stuck in writing an XSLT to remove extra roes and duplicate nodes. SO need your help.

My XML looks like following:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Rowsets CachedTime="" DateCreated="2015-05-05T19:27:06" EndDate="2015-05-05T19:27:06" StartDate="2015-05-05T18:27:06" Version="14.0.0 Build(802)">
    <Rowset>
        <Columns>
            <Column Description="DateTime" MaxRange="0" MinRange="0" Name="DateTime" SQLDataType="93" SourceColumn="DateTime"/>
            <Column Description="" MaxRange="0" MinRange="0" Name="_10LI132.PV" SQLDataType="6" SourceColumn="10LI132.PV"/>
            <Column Description="" MaxRange="0" MinRange="0" Name="_10LQ132.PV" SQLDataType="6" SourceColumn="10LQ132.PV"/>
            <Column Description="" MaxRange="0" MinRange="0" Name="_10TI112.PV" SQLDataType="6" SourceColumn="10TI112.PV"/>
            <Column Description="" MaxRange="0" MinRange="0" Name="_10LI135.PV" SQLDataType="6" SourceColumn="10LI135.PV"/>
            <Column Description="" MaxRange="0" MinRange="0" Name="_10LQ132.PV" SQLDataType="6" SourceColumn="10LQ132.PV"/>
            <Column Description="" MaxRange="0" MinRange="0" Name="_10LI127.PV" SQLDataType="6" SourceColumn="10LI127.PV"/>
            <Column Description="" MaxRange="0" MinRange="0" Name="_10TI112.PV" SQLDataType="6" SourceColumn="10TI112.PV"/>
            <Column Description="" MaxRange="0" MinRange="0" Name="_10LQ127.PV" SQLDataType="6" SourceColumn="10LQ127.PV"/>
        </Columns>
        <Row>
            <DateTime>2015-05-05T18:27:06</DateTime>
            <A>55465.359375</A>
            <B>1808040</B>
            <C>-331.424926757812</C>
            <D>-74553.75</D>
            <B>1808040</B>
            <F>-10100.994140625</F>
            <C>-331.424926757812</C>
            <G>-445363.5625</G>
        </Row>
        <Row>
            <DateTime>2015-05-05T18:27:06</DateTime>
            <A>NA</A>
            <B>NA</B>
            <C>NA</C>
            <D>NA</D>
            <B>1808040</B>
            <F>NA</F>
            <C>NA</C>
            <G>NA</G>
        </Row>
        <Row>
            <DateTime>2015-05-05T18:27:06</DateTime>
            <A>NA</A>
            <B>NA</B>
            <C>NA</C>
            <D>NA</D>
            <B>NA</B>
            <F>NA</F>
            <C>-331.424926757812</C>
            <G>NA</G>
        </Row>
    </Rowset>
</Rowsets>

I want my resultant XML as following:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Rowsets CachedTime="" DateCreated="2015-05-05T19:27:06" EndDate="2015-05-05T19:27:06" StartDate="2015-05-05T18:27:06" Version="14.0.0 Build(802)">
    <Rowset>
        <Columns>
            <Column Description="DateTime" MaxRange="0" MinRange="0" Name="DateTime" SQLDataType="93" SourceColumn="DateTime"/>
            <Column Description="" MaxRange="0" MinRange="0" Name="_10LI132.PV" SQLDataType="6" SourceColumn="10LI132.PV"/>
            <Column Description="" MaxRange="0" MinRange="0" Name="_10LQ132.PV" SQLDataType="6" SourceColumn="10LQ132.PV"/>
            <Column Description="" MaxRange="0" MinRange="0" Name="_10TI112.PV" SQLDataType="6" SourceColumn="10TI112.PV"/>
            <Column Description="" MaxRange="0" MinRange="0" Name="_10LI135.PV" SQLDataType="6" SourceColumn="10LI135.PV"/>
            <Column Description="" MaxRange="0" MinRange="0" Name="_10LQ132.PV" SQLDataType="6" SourceColumn="10LQ132.PV"/>
            <Column Description="" MaxRange="0" MinRange="0" Name="_10LI127.PV" SQLDataType="6" SourceColumn="10LI127.PV"/>
            <Column Description="" MaxRange="0" MinRange="0" Name="_10TI112.PV" SQLDataType="6" SourceColumn="10TI112.PV"/>
            <Column Description="" MaxRange="0" MinRange="0" Name="_10LQ127.PV" SQLDataType="6" SourceColumn="10LQ127.PV"/>
        </Columns>
        <Row>
            <DateTime>2015-05-05T18:27:06</DateTime>
            <A>55465.359375</A>
            <B>1808040</B>
            <C>-331.424926757812</C>
            <D>-74553.75</D>
            <F>-10100.994140625</F>
            <G>-445363.5625</G>
        </Row>
    </Rowset>
</Rowsets>

PLease note that nodes , ets are dynamically generated so cannot hard-code them in XSLT.

Let me know if you hv got any ideas to solve my issue.

Thanks in advance.

Change Visual Studio 2013 Summary Tag Color on Dark Theme

When I have the Blue Theme on VS2013, the summary shows as:

Summary on Blue Theme

But when I change to my preferred theme, the Dark theme, the summary tag becomes all green:

Summary on Dark Theme

I like the grayed out version, since it gives more attention to the summary's text, instead of the tag itself, I just can't find how to change it on the Dark theme... any ideas? (I tried the color theme editor, but didn't help much).

How to access parent XML elements using Groovy/GPath

Using the following XML can anyone tell me how in Groovy (Gpath or Xpath) I perform a select on the left most element and also include a reference back to the correct parent element?

<CompoundEmployee>
  <person>
    <person_id_external>21554</person_id_external>
    <employment_information>
      <start_date>2014-02-27</start_date>
      <job_information><end_date>2013-04-21</end_date><event>H</event><start_date>2012-09-28</start_date></job_information>
      <job_information><end_date>2013-04-26</end_date><event>5</event><start_date>2013-04-22</start_date></job_information>
      <job_information><end_date>9999-12-31</end_date><event>R</event><start_date>2014-02-27</start_date></job_information>
    </employment_information>
  </person>
  <person>
    <person_id_external>8265</person_id_external>
    <employment_information>
      <start_date>2000-10-02</start_date>
      <job_information><end_date>2014-10-24</end_date><event>5</event><start_date>2014-05-22</start_date></job_information>
      <job_information><end_date>2014-05-21</end_date><event>H</event><start_date>2000-10-02</start_date></job_information>
      <job_information><end_date>9999-12-31</end_date><event>5</event><start_date>2014-10-25</start_date></job_information>
    </employment_information>
  </person>
  <execution_timestamp>2015-05-05T08:17:51.000Z</execution_timestamp>
  <version_id>1502P0</version_id>
</CompoundEmployee>

The select statement written in English is:

"Start Date of Job Information record is less than Employement Information Start Date AND Job Information event type is one of Hire or Rehire"

The elements returned by the query must include person_id_external from employment_information along with start_date from job_information.

So far I have tried.....

def xml = """ xml from above """
def list = new XmlSlurper().parseText(xml)
x = list.'**'.findAll { person ->
    person.event.text() in ['H','R'] && person.start_date.text() < list.person.employment_information.start_date.text()
} 
x.each { l -> println "Type -> ${l.event}, Start Date -> ${l.start_date}, End Date -> ${l.end_date}" }

which works great when there is only one person in the input file but when there are multiple employees the results are incorrect due to the wrong "list.person.employment_information.start_date" being referenced i.e. the parent/child nodes are not related.

Based on the above an example of the output is:

Type -> H, Start Date -> 2012-09-28, End Date -> 2013-04-21

Type -> R, Start Date -> 2014-02-27, End Date -> 9999-12-31

Type -> H, Start Date -> 2000-10-02, End Date -> 2014-05-21

where in fact it should return only 1 row:

Type -> H, Start Date -> 2012-09-28, End Date -> 2013-04-21

As you can see I am nearly there but I just can't work out how to reference and return the logically correct parent employment_information record.

Any ideas anyone?

Thanks, Greg

templating ejs in node for xml

I have a big well-formed xml and I want tempalte it like do ejs.

`<foo>
  <url><%= url %></url>
<foo>`

but if I do

res.render('template.xml', { url: 'http://foo.com' })

I am getting

Error: Cannot find module 'xml'

Can anyone suggest how to deal with it? I need just insert values in already formed xml, I don't want to serialize object to xml by schema. THank you in advance

Warnings in generating wsdl and soap stub codes using ws-security plugin and gsoap

I have a header file say myService.h in which I have included #import wsse.h in top of the file. Now,

soapcpp2 -S -x -e -Igsoap-2.8/gsoap/import -c myService.h

After firing the above command, I am getting 50 warnings:

**WARNING**: SOAP RPC encoding does not support XML attributes (detected at line 76 in wsu.h)

**WARNING**: SOAP RPC encoding does not support XML attributes (detected at line 118 in wsse.h)

and so on.....

I have tried adding two following lines in myService.h:

//gsoap myService schema elementForm: qualified

//gsoap myService schema attributeForm: qualified

But it didn't work...

What should I do to get rid of these warnings?

XSLT muenchian grouping with the help of key

I am trying to get to a solution and so far have got nothing. What I am trying to achieve is to transform

Input:
<?xml version="1.0" encoding="utf-8"?>
<Root>
    <Query>
        <ID>123123</ID>
        <NameOfTeam>Team1</NameOfTeam>
        <RaisingYear>2014</RaisingYear>
        <Brief>N/A</Brief>
        <TeamMembers>
          <Member>
            <Name>Person1</Name>
            <Role>Role1</Role>
          </Member>
          <Member>
            <Name>Person2</Name>
            <Role>Role2</Role>
          </Member>
            <Name>N/A</Name>
            <Role>
              Role4
            </Role>
          </Member>
        </TeamMembers>
        <TeamMembers2>
          <Member>
            <Name>Person3</Name>
            <Role>Role3</Role>
          </Member>
          <Member>
            <Name>Person4</Name>
            <Role>Role4</Role>
          </Member>
          <Member>
            <Name>Person5</Name>
            <Role>Role5</Role>
          </Member>
        </TeamMembers2>
        <Projects>
          <Project>NISAR</Project>
        </Projects>
        <Documents>
          <Document>
            <Language>en</Language>
            <LanguageName>English</LanguageName>
            <GeneralInfo>Useless project</GeneralInfo>
          </Document>
        </Documents>
      </Query>
      <Query>
        <ID>123124</ID>
        <NameOfTeam>Team2</NameOfTeam>
        <RaisingYear>2012</RaisingYear>
        <Brief>N/A</Brief>
        <TeamMembers>
          <Member>
            <Name>Person6</Name>
            <Role>Role1</Role>
          </Member>
          <Member>
            <Name>Person7</Name>
            <Role>Role2</Role>
          </Member>
            <Name>Person8</Name>
            <Role>Role3</Role>
          </Member>
        </TeamMembers>
        <TeamMembers2>
          <Member>
            <Name>Person3</Name>
            <Role>Role3</Role>
          </Member>
          <Member>
            <Name>Person4</Name>
            <Role>Role4</Role>
          </Member>
          <Member>
            <Name>Person5</Name>
            <Role>Role5</Role>
          </Member>
        </TeamMembers2>
        <Projects>
          <Project>MissionMars</Project>
        </Projects>
        <Documents>
          <Document>
            <Language>en</Language>
            <LanguageName>English</LanguageName>
            <GeneralInfo> </GeneralInfo>
          </Document>
          <Document>
            <Language>en</Language>
            <LanguageName>English</LanguageName>
            <GeneralInfo>It is a rubbish comment</GeneralInfo>
          </Document>
          <Document>
            <Language>fr</Language>
            <LanguageName>English</LanguageName>
            <GeneralInfo>It is another rubbish comment.</GeneralInfo>
          </Document>
        </Documents>
    </Query>
</Root>

to

Output:

<?xml version="1.0" encoding="utf-8"?>
<Root>
    <Query>
        <ID>123123</ID>
        <NameOfTeam>Team1</NameOfTeam>
        <RaisingYear>2014</RaisingYear>
        <Brief>N/A</Brief>
        <TeamMembers>
          <Member>
            <Name>Person1</Name>
            <Role>Role1</Role>
          </Member>
          <Member>
            <Name>Person2</Name>
            <Role>Role2</Role>
          </Member>
            <Name>N/A</Name>
            <Role>
              Role4
            </Role>
          </Member>
        </TeamMembers>
        <TeamMembers2>
          <Member>
            <Name>Person3</Name>
            <Role>Role3</Role>
          </Member>
          <Member>
            <Name>Person4</Name>
            <Role>Role4</Role>
          </Member>
          <Member>
            <Name>Person5</Name>
            <Role>Role5</Role>
          </Member>
        </TeamMembers2>
        <Projects>
          <Project>NISAR</Project>
        </Projects>
        <Documents>
          <Document>
            <Language>en</Language>
            <LanguageName>English</LanguageName>
            <GeneralInfo>Useless project</GeneralInfo>
          </Document>
        </Documents>
      </Query>
      <Query>
        <ID>123124</ID>
        <NameOfTeam>Team2</NameOfTeam>
        <RaisingYear>2012</RaisingYear>
        <Brief>N/A</Brief>
        <TeamMembers>
          <Member>
            <Name>Person6</Name>
            <Role>Role1</Role>
          </Member>
          <Member>
            <Name>Person7</Name>
            <Role>Role2</Role>
          </Member>
            <Name>Person8</Name>
            <Role>Role3</Role>
          </Member>
        </TeamMembers>
        <TeamMembers2>
          <Member>
            <Name>Person3</Name>
            <Role>Role3</Role>
          </Member>
          <Member>
            <Name>Person4</Name>
            <Role>Role4</Role>
          </Member>
          <Member>
            <Name>Person5</Name>
            <Role>Role5</Role>
          </Member>
        </TeamMembers2>
        <Projects>
          <Project>MissionMars</Project>
        </Projects>
        <Documents>
          <Document>
            <Language>en</Language>
            <LanguageName>English</LanguageName>
            <GeneralInfo>It is a rubbish comment</GeneralInfo>
          </Document>
          <Document>
            <Language>fr</Language>
            <LanguageName>English</LanguageName>
            <GeneralInfo>It is another rubbish comment.</GeneralInfo>
          </Document>
        </Documents>
    </Query>
</Root>

All document with same ID and Language information should be merged and if any of the details in document tag is empty than it should be replaced, only if available, by other document tag's information with same language tag.

The code that I am using for it is

<xsl:stylesheet version="1.0"
 xmlns:xsl="http://ift.tt/tCZ8VR">
  <xsl:output omit-xml-declaration="yes" indent="yes"/>

  <xsl:key name="QueryIDAndLangauge" match="Query" use="concat(ID, '+', Documents/Document/Language)"/>

  <xsl:key name="DocumentsAndLanguage" match="Language" use="Language"/>

  <xsl:key name="DocumentsAndLanguageValue" match="Language" use="concat(ID, '+', .)"/>

  <xsl:template match="node()|@*">
    <xsl:copy>
      <xsl:apply-templates select="node()|@*"/>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="/*">
    <Root>
      <xsl:apply-templates select=
   "Query[generate-id()
          =
           generate-id(key('QueryIDAndLangauge',
                          concat(ID, '+', Documents/Document/Language)
                          )
                           [1]
                      )
           ]
   "/>
    </Root>
  </xsl:template>

  <xsl:template match="Document">
    <Document>
      <xsl:apply-templates select=
    "key('DocumentsAndLanguage', ../../ID)
        [generate-id()
        =
         generate-id(key('DocumentsAndLanguageValue',
                         concat(../../ID, '+', Langauge)
                         )
                          [1]
                     )
         ]
    "/>
    </Document>
  </xsl:template>
</xsl:stylesheet>

Thanks in Advance.

P.S.: Needless to mention, I am doing it in XSLT 1.0

Storing and retrieving large data in C# [on hold]

Currently, I am working on a project where I need to bring approx 100 Millions row of data from a table on to client code to retrieve the data faster.

The loading of data would be one time process so instead of making a database call I want to store it locally. somewhere in collection/xml and define function to get the row details:

I am not in a position to look into DB structure as its a third party vendor and I have to optimize the response time.

SO i want to save time for DB connection and return the data from any existing collection/ customised collection/xml/json.

It could be a local file stored having all these 10M rows and fetch the data from that one.

Pls suggest.

lets say: I have to

public list<mylist> GetDetailsbyId (int id)
{
//implementation
}

public list<mylist> GetDetailsbyName (string name)
{
//implementation
}

Can any one suggest what would be ideal way to store these large volume of data in c# code. I am thinking of XML.

Using org.apache.cxf.binding.soap.SoapMessage for creating SOAP WS project

I want to use org.apache.cxf.binding.soap.SoapMessage and org.apache.cxf.message.Message for testing of SOAP Web-service. I have project and .xml and .msg files for tests, but I don't know, how can I create message with cxf.binding.soap.SoapMessage and send this message into WS. I have this steps in project:

  1. Upload xml or msg file
  2. Create SoapMessage and Message variables
  3. Try create SoapMessage and overwrite this messgae with security header, which contains information about cert
  4. Send this message into WS and get response

But I catched java.lang.NullPointerException into SoapMessage. Please, give me advice or some links, which show me how I can correctly create SoapMessage and send it. UPD: Also, I asked about SoapMessage here but I haven't exact answer

Apache-Camel: camelcontext does not seem to work

Details:

JARs used - camel-core-2.5.0.jar , camel-spring-2.5.0.jar

Configuration file:

<?xml version = "1.0" encoding = "UTF-8"?>
<beans xmlns="http://ift.tt/GArMu6"
    xmlns:amq="http://ift.tt/1dv78M9"
    xmlns:xsi="http://ift.tt/ra1lAU"
    xmlns:jms="http://ift.tt/1iMF6wC"
    xmlns:tx="http://ift.tt/OGfeU2"
    xmlns:camel="http://ift.tt/TZ5qsO"
    xsi:schemaLocation="http://ift.tt/GArMu6 http://ift.tt/GAf8ZW
  http://ift.tt/1dv78M9 http://ift.tt/1d8NZeh
  http://ift.tt/1iMF6wC http://ift.tt/1BuJ5p4
  http://ift.tt/OGfeU2 http://ift.tt/OGffan 
  http://ift.tt/TZ5qsO http://ift.tt/1c41eV6
  ">

    <camel:camelContext id="camelContext" xmlns="http://ift.tt/TZ5qsO">
        <camel:package>com.myapp.routes</camel:package>
    </camel:camelContext>

and we have a file that extends routebuilder

public class SomeRouteBuilder extends RouteBuilder {

...
...

public void configure() throws Exception {

...
...

from("file://E:/somedirectory/".process(new FileWaitProcessor()).process(new Processor() {

xml to xslt conversion with xsd

I have 4 Xml files 1 xsd file need to convert xslt. I have written Java Code that is working properly but not able to convert xslt. for example purpose you can see this URL. http://ift.tt/1c41eEw anyone please help me to get at least a single attribute from XML.