GithubHelp home page GithubHelp logo

jgimenes / bw5_split_large_xml Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 9 KB

:notebook: Split an XML file into smaller parts with a pre-defined number of elements per node, without using plugins.

businessworks bw5 tibco

bw5_split_large_xml's Introduction

TIBCO BusinessWorks 5.X - Split Large XML File

This proof of concept demonstrates how to split an XML file into smaller parts with a pre-defined number of elements per node, without using plugins.

Example

To exemplify the operation, the following XML file was used, and the number of elements per node was defined as 3 in GV BW_SPLIT_LARGE_XML/nodeSize

  <?xml version = "1.0" encoding = "UTF-8"?>
  <ns0:employees xmlns:ns0="http://www.tibco.com/schemas/BW5_SPLIT_LARGE_XML/Shared Resources/Schemas/Schema.xsd">
      <ns0:employee>
	      <ns0:id>1</ns0:id>
	      <ns0:firstName>Jose</ns0:firstName>
	      <ns0:lastName>Silva</ns0:lastName>
	      <ns0:email>[email protected]</ns0:email>
      </ns0:employee>
      <ns0:employee>
	      <ns0:id>2</ns0:id>
	      <ns0:firstName>Mariana</ns0:firstName>
	      <ns0:lastName>Leal</ns0:lastName>
	      <ns0:email>[email protected]</ns0:email>
      </ns0:employee>
      <ns0:employee>
	      <ns0:id>3</ns0:id>
	      <ns0:firstName>Patricia</ns0:firstName>
	      <ns0:lastName>Lima</ns0:lastName>
	      <ns0:email>[email protected]</ns0:email>
      </ns0:employee>
      <ns0:employee>
	      <ns0:id>4</ns0:id>
	      <ns0:firstName>Lucas</ns0:firstName>
	      <ns0:lastName>Machado</ns0:lastName>
	      <ns0:email>[email protected]</ns0:email>
      </ns0:employee>
      <ns0:employee>
	      <ns0:id>5</ns0:id>
	      <ns0:firstName>Carlos</ns0:firstName>
	      <ns0:lastName>Cardoso</ns0:lastName>
	      <ns0:email>[email protected]</ns0:email>
      </ns0:employee>
      <ns0:employee>
	      <ns0:id>6</ns0:id>
	      <ns0:firstName>Naiara</ns0:firstName>
	      <ns0:lastName>Campos</ns0:lastName>
	      <ns0:email>[email protected]</ns0:email>
      </ns0:employee>
      <ns0:employee>
	      <ns0:id>7</ns0:id>
	      <ns0:firstName>Manoel</ns0:firstName>
	      <ns0:lastName>Oliveira</ns0:lastName>
	      <ns0:email>[email protected]</ns0:email>
      </ns0:employee>
      <ns0:employee>
	      <ns0:id>8</ns0:id>
	      <ns0:firstName>Lucia</ns0:firstName>
	      <ns0:lastName>Franco</ns0:lastName>
	      <ns0:email>[email protected]</ns0:email>
      </ns0:employee>
   </ns0:employees>

The execution of the process will generate 3 XML files, as shown in the examples below.

Output XML 01
<?xml version = "1.0" encoding = "UTF-8"?>
<ns0:employees xmlns:ns0 = "http://www.tibco.com/schemas/BW5_SPLIT_LARGE_XML/Shared Resources/Schemas/Schema.xsd">
	<ns0:employee>
		<ns0:id>1</ns0:id>
		<ns0:firstName>Jose</ns0:firstName>
		<ns0:lastName>Silva</ns0:lastName>
		<ns0:email>[email protected]</ns0:email>
	</ns0:employee>
	<ns0:employee>
		<ns0:id>2</ns0:id>
		<ns0:firstName>Mariana</ns0:firstName>
		<ns0:lastName>Leal</ns0:lastName>
		<ns0:email>[email protected]</ns0:email>
	</ns0:employee>
	<ns0:employee>
		<ns0:id>3</ns0:id>
		<ns0:firstName>Patricia</ns0:firstName>
		<ns0:lastName>Lima</ns0:lastName>
		<ns0:email>[email protected]</ns0:email>
	</ns0:employee>
</ns0:employees>
Output XML 02
<?xml version = "1.0" encoding = "UTF-8"?>
<ns0:employees xmlns:ns0 = "http://www.tibco.com/schemas/BW5_SPLIT_LARGE_XML/Shared Resources/Schemas/Schema.xsd">
	<ns0:employee>
		<ns0:id>4</ns0:id>
		<ns0:firstName>Lucas</ns0:firstName>
		<ns0:lastName>Machado</ns0:lastName>
		<ns0:email>[email protected]</ns0:email>
	</ns0:employee>
	<ns0:employee>
		<ns0:id>5</ns0:id>
		<ns0:firstName>Carlos</ns0:firstName>
		<ns0:lastName>Cardoso</ns0:lastName>
		<ns0:email>[email protected]</ns0:email>
	</ns0:employee>
	<ns0:employee>
		<ns0:id>6</ns0:id>
		<ns0:firstName>Naiara</ns0:firstName>
		<ns0:lastName>Campos</ns0:lastName>
		<ns0:email>[email protected]</ns0:email>
	</ns0:employee>
</ns0:employees>
Output XML 03
<?xml version = "1.0" encoding = "UTF-8"?>
<ns0:employees xmlns:ns0 = "http://www.tibco.com/schemas/BW5_SPLIT_LARGE_XML/Shared Resources/Schemas/Schema.xsd">
	<ns0:employee>
		<ns0:id>7</ns0:id>
		<ns0:firstName>Manoel</ns0:firstName>
		<ns0:lastName>Oliveira</ns0:lastName>
		<ns0:email>[email protected]</ns0:email>
	</ns0:employee>
	<ns0:employee>
		<ns0:id>8</ns0:id>
		<ns0:firstName>Lucia</ns0:firstName>
		<ns0:lastName>Franco</ns0:lastName>
		<ns0:email>[email protected]</ns0:email>
	</ns0:employee>
</ns0:employees>

bw5_split_large_xml's People

Contributors

jgimenes avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.