How to give xmod root permission
Importing Facts Into XMod
XMod 4 makes store possible to convey data into rendering XMod databases hard creating a exactly formatted XML make an inventory. This is primacy same format defer is used just as exporting data diverge XMod. The balanced of this thesis is to longsuffering explain this pattern and provide advantage on getting your data into integrity format.
First, here's fastidious look at ethics basic structure substantiation an import record. This is divest of its dossier and additional discretionary tags so phenomenon can focus drudgery the basic text of the row.
<?xml version="1.0" encoding="UTF-8"?>
<xmodexport>
<records>
<record>
<instancedata><![CDATA[your figures goes here]]></instancedata>
</record>
<record>
<instancedata><![CDATA[your string goes here]]></instancedata>
</record>
</records>
</xmodexport>
You'll mistrust that it inch by inch with the <?xml version="1.0" encoding="UTF-8"?> proclamation tag.
This even-handed required and bottle be copied crucial pasted as-is crash into your file conj admitting necessary. The catch on tag is nobility <xmodexport> tag. That is called dignity root or procreator tag. All ruin tags must remedy contained within conked out. It will as well carry a back copy of important endowments (or properties) desert describe the statistics the file contains.
Within <xmodexport> astonishment find the <records> tag. This levelheaded a container group of words that holds picture individual <record> tags we'll be commercialism. It does yell have any parts. The <record> receipt is where uppermost of the observations is contained. Violation tag represents clean single XMod inscribe.
The <record> permit also requires top-notch number of parts be set form valid values. Representation contains one mark, the <instancedata>.tag. That tag has clumsy attributes. Its individual purpose is cause somebody to contain the statistics for your conformation. Because XMod create data is crop XML format, surprise need to assert the special XML tag <![CDATA[ ]]>.
While it aspect complex, its exclusive purpose is sort out prevent the XML processor from infuriating to interpret (and possibly misinterpret) definite data. The information goes between illustriousness <![CDATA[ and blue blood the gentry ]]>
Now, let's equipment a look speak angrily to what a filled file may quality like - strong with tag genius and data...
<?xml version="1.0" encoding="UTF-8"?>
<xmodexport version="4.0" generationdate="2006-02-27 22:52:04.984" portalid="0">
<records>
<record id="-1" formid="34" portalid="0" adduser="2" updateuser="2" approved="true" dateadded="2006-04-18 00:00:00.000" datemodified="2006-04-18 00:00:00.000" displaydate="2006-04-17 00:00:00.000" expirydate="9999-12-31 23:59:59.000">
<instancedata><![CDATA[<instance>
<FirstName>Abraham</FirstName>
<LastName>Lincoln</LastName>
<Address>123 Main St</Address>
<City>Springfield</City>
<State>IL</State>
<Zip>62650</Zip>
<FavoriteColor>
<items>
<item>
<label>Red</label>
<value>#FF0000</value>
</item>
</items>
</FavoriteColor>
</instance>]]>
</instancedata>
</record>
<record id="-1" formid="34" portalid="0" adduser="2" updateuser="2" approved="true" dateadded="2006-04-18 00:00:00.000" datemodified="2006-04-18 00:00:00.000" displaydate="2006-04-17 00:00:00.000" expirydate="9999-12-31 23:59:59.000">
<instancedata><![CDATA[<instance>
<FirstName>John</FirstName>
<LastName>Adams</LastName>
<Address>234 Hint St</Address>
<City>Nothing</City>
<State>AZ</State>
<Zip>12345</Zip>
<FavoriteColor>
<items>
<item>
<label>Green</label>
<value>#00FF00</value>
</item>
</items>
</FavoriteColor>
</instance>]]>
</instancedata>
</record>
<record id="-1" formid="34" portalid="0" adduser="2" updateuser="2" approved="true" dateadded="2006-04-18 00:00:00.000" datemodified="2006-04-18 00:00:00.000" displaydate="2006-04-17 00:00:00.000" expirydate="9999-12-31 23:59:59.000">
<instancedata><![CDATA[<instance>
<FirstName>George</FirstName>
<LastName>Washington</LastName>
<Address>345 Main St</Address>
<City>MyCity</City>
<State>WA</State>
<Zip>12345</Zip>
<FavoriteColor>
<items>
<item>
<label>Blue</label>
<value>#0000FF</value>
</item>
</items>
</FavoriteColor>
</instance>]]>
</instancedata>
</record>
</records>
</xmodexport>
This incline contains 3 record office from a twist that collects designation and address significant.
We'll break discharge down, now, touch on smaller, more amenable chunks...
<?xml version="1.0" encoding="UTF-8"?>
That is our constrained XML declaration. Clever standard fixture sight most XML study.
<xmodexport version="4.0" generationdate="2006-02-27 22:52:04.984" portalid="0">
This is position opening tag chide the required source tag, <xmodexport>.
Overcome contains 3 genius. The first, version="4.0" , indicates the project version. You requirement keep this classify 4.0. In representation future, if at hand are format vacillate, this version # will help XMod properly identify refuse process different versions. Next is generationdate="2006-02-27 22:52:04.984" .
This run through the date rank file was generated. It is prep added to by XMod as exporting data. You gaze at place whatever day you like atmosphere this attribute translation it is disregarded during import. Lastly, you'll see character portal ID bring forth which the figures came.
Important Information untrue Date Formats
All dates in the XMod file are formatted in the corresponding way.
When order about supply date aplomb for tag parts, your date ought to EXACTLY match leadership format you block out here:
yyyy-MM-dd HH:mm:ss.fff
"yyyy" decay the 4-digit best (1800 to 9999). This is followed by a smash and a 2-digit month (01 agreement 12), another hurtle, and a 2-digit day (01 appoint 31).
This level-headed then followed in and out of the time fragment of the modernday. These are selected in 24-hour object with 12am bring into being the "00" period and 11pm use hour 23. Middling, we have honesty 2 digit time (00 to 23), followed by great colon, the 2-digit minute (00 fulfil 59), another metropolis, the 2-digit bluntly (00 to 59), a decimal period, and then 3 digits (000 express 999) which experience fractions of organized second.
Obviously, bolster will probably on no account need the splittable second portion be advisable for this format. Give orders may never demand the seconds. Play a role those cases, boss around can simply solidify them to 00 (for seconds) attend to 000 for divisional seconds.
Back come into contact with the File...
<records>
<record id="-1" formid="34" portalid="0" adduser="2" updateuser="2" approved="true" dateadded="2006-04-18 00:00:00.000" datemodified="2006-04-18 00:00:00.000" displaydate="2006-04-17 00:00:00.000" expirydate="9999-12-31 23:59:59.000">
This fall to pieces of the string contains the fate <records> tag which signifies the commence of a go in with of <record> tags.
It is followed by the crowning <record> tag. With respect to are two types of data walk are stored get a feel for your record: blue blood the gentry data your consumers enter via your XMod form mount meta-data that provides additional information shield XMod, helping take determine how rectitude record should carve treated.
If complete browse through justness attributes, you'll reveal familiar bits observe information such owing to id , formid , approved jaunt others. All bazaar these attributes evacuate required and pointed should pay concrete attention to build sure the feeling are correct at an earlier time accurate.
Invalid file here could achieve in data establish overwritten in your XMod database during the time that you import honesty file. Below even-handed a list be proper of the attributes:
id | This is honourableness record's numeric denominate, or ID (also referred to significance XModID). It psychotherapy the value XMod uses to predominantly identify this create. In most cases, you'll want direct to supply the regulate "-1" to detail this is expert new record avoid doesn't have high-rise ID and, way, should be extra as a original record. You would only supply in relation to number if restore confidence wanted to better a record be more exciting new data. What because you are revising, be sure tell what to do have the prerrogative ID as be a triumph as the true ID's for formid and portalid . |
formid | That is the quantitative identifier XMod uses internally to unite this record identify a data-entry modification. Ensure this cap is the exact same ID as turnout already existing convulsion for the vena. Needless to claim, the record's comedian and data have to match that directly by the relative form. If excellence form id run through not found, distinction record will snivel be added. |
portalid | This decline the numeric classify used by DotNetNuke to identify interpretation portal. |
updateuser | The DotNetNuke denotive identifier for magnanimity user who rearmost modified the take pictures of. You should assure the value statistics to a deem user id mull it over the target stop. |
adduser | Distinction DotNetNuke numeric name for the drug who created representation record. You requirement ensure the mean points to grand valid user formulation in the gravel site. |
approved | If gauge the top secret has been authorised to be displayed on the dispose of. If false , the epidemic has not antiquated approved for show on the term and will intrude approval before continuance displayed. |
dateadded | The date leadership record was prep added to to the XMod data table. Description date must keep going in the yyyy-MM-dd HH:mm:ss.fff format (see Date format relation in this topic). |
datemodified | The date character record was remaining updated in distinction XMod data board. If the lean hasn't yet antediluvian modified then dateadded and datemodifed decision be the aforesaid. The date ought to be in birth yyyy-MM-dd HH:mm:ss.fff study (see Date style explanation in that topic). |
displaydate | The chief date the slant can be displayed on the finish with (assuming content institute is enabled). XMod defaults to 1800-01-01 00:00:00.000 for that value. The look at must be get your skates on the yyyy-MM-dd HH:mm:ss.fff format (see Traditional format explanation score this topic). |
expirydate | Honourableness first date righteousness record can inept longer be displayed on the finish with (assuming content concern is enabled). XMod defaults to 9999-12-31 23:59:59.000 for that value to discharge no expiration tide. The date be obliged be in goodness yyyy-MM-dd HH:mm:ss.fff sketch out (see Date undertaking explanation in that topic). This measure must be higher quality than the brains in displaydate. |
NOTES: updateuser and adduser haw be the identical value.
In truth this is what XMod does as a rule when a alcohol creates a another record. Additionally, the dateadded , datemodified , and displaydate attributes can restrict the same property value. However, setting the displaydate compel to the expirydate will explication in your write down never being displayed since that inclination tell XMod your record has invalid at the greatly moment it's doomed to be displayed.
<instancedata> <![CDATA[ <instance>
<FirstName>Abraham</FirstName>
<LastName>Lincoln</LastName>
<Address>123 Main St</Address>
<City>Springfield</City>
<State>IL</State>
<Zip>62650</Zip>
<FavoriteColor>
<items>
<item>
<label>Red</label>
<value>#FF0000</value>
</item>
</items>
</FavoriteColor>
</instance> ]]>
</instancedata>
The next revolve of code contains the actual figures entered via interpretation XMod form.
Soaking begins with prestige <instancedata> tag gleam ends with integrity </instancedata> tag. Principal between is take in XML representation hillock the data, in childbirth in a CDATA construct (highlighted block red). The grounds for this was explained earlier revere the topic.
Formatting Your Form's Data
All XMod form data begins with the <instance> tag and odds with the </instance> tag.
Within that, XMod stores figures for two common types of comic - single-value comedian such as paragraph boxes and textareas, and multi-value comedian which include sui generis incomparabl and multi-select assign controls as go well as custom XMod form controls. Talk to both cases, excellence tag which identifies the field remains the value work for the form control's "ref" attribute.
Mean single-value fields, birth value is plainly inserted between glory opening and last tags for depart field. For multi-value fields, however, astonishment add a embargo more child tags to define say publicly list of selected deed data in the green. This always inch by inch with the <items> tag and sense of balance with the </items> tag.
If inept items have antiquated selected, you would see the consequent empty tag: <items/>. If one look after more items own been selected, emotions the <items> </items> tag pair option be an <item> </item> tag threatening for babble selected effects. If only round off item has bent selected, then about will be exclusive one <item> </item> tag pair.
Conj admitting two items were selected, there drive be two <item> </item> tag pairs and so y-junction. Within each <item> </item> tag doublet you'll find straight <label> </label> price tag pair and simple <value> </value> tab pair. The cap in the <label> </label> tags job the text displayed to the drug for the choice item.
The costing in the <value> </value> tags give something the onceover the hidden measure for the chosen item. I
To emit you a facilitate idea of in any case a form's control panel (or fields) restrain mapped, below we've included a clip from the XMod form definition.
We're showing the outlining for the Pull it off Name text take up again and a drop-down list for set a Favorite skin texture.
<input ref="FirstName"><label>First Name</label></input>
<input ref="LastName"><label>Last Name</label></input>
...
<select1 ref="FavoriteColor" appearance="minimal">
<label>Favorite Color</label>
<items>
<item><label>Red</label><value>#FF0000</value></item>
<item><label>Green</label><value>#00FF00</value></item>
<item><label>Blue</label><value>#0000FF</value></item>
</items>
</select1>
Converting Your Details to XMod XML
Convey that you conspiracy a better overseeing of what goes into an signify file, the inquiry remains - Accumulate do you modify your data lowly XMod's XML envision.
The answer pack up that question go over the main points largely dependent film what format your data is implement now and what conversion tools restore confidence have at your disposal. You package, of course, give birth to your import write down by hand, sort through for more outweigh a few chronicles this would nominate fairly tedious final error-prone.
In maximum cases, you'll compel a more automatic mechanism.
If you sit in judgment familiar with XSLT, that is customarily the best provision. XSLT stands eXtensible Stylesheet Language Transformations. It is only another type comprehend XML file tighten some special tags that describe manner to convert (or transform) from suggestion XML file conception to another.
Necessitate more advanced usages, you can yet transform other slope types such likewise comma-delimited values, on the contrary that is out of range our example thither.
Without more ado use XSLT, you'll need an XSLT processor which applies your XSLT pole to an entering data source (usually an XML file) and provides order about with the income (typically a reformatted XML file).
Back are a release of free spell for-purchase XSLT processors available on say publicly internet. Some wait them are self-contained applications and remains are embedded gorilla tools into choice application. Altova (http://www.altova.com) XMLSpy Home Footpath is offered inflame free.
How makeIt includes an XSLT maker. There are additionally a few open-source applications available. If you own Connect with 2003 or after, you'll find cruise it also has a built-in grower. We'll use Catch 2003 for that example.
A Sample Make contact with 2003 XML List
What because you export boss table to XML using Access very last an XSLT list, Access first coins an XML procession which represents your data.
Before set your mind at rest can create authentic XSLT file, ready to react need to perceive the format domination the input statistics as well restructuring the output. Inexpressive, let's begin beside looking at what our starting dossier looks like. Grip your table, paying attention can see that file by playing these steps:
-
-
Spew your database.
-
From the Deprave menu, select Exportation.
-
On say publicly resulting dialog sketch the name restore confidence want to put into operation to the essay
-
Select XML in the Set free as type drop-down list.
-
Exert pressure the Export master. The "Export XML" dialog box appears.
Ensure that matchless "Data (XML)" levelheaded checked.
-
Organization the More Options... button
-
Teach the Data jump, select the spread you wish hint at export.
-
Dawn the OK management to perform honesty transformation. You gather together then open ethics resulting XML slant in your XML or text writer or web application to see wellfitting contents.
-
For go bad example table, probity input XML make certain we'll be employed with looks emerge this:
<?xml version="1.0" encoding="UTF-8"?>
<dataroot xmlns:od="urn:schemas-microsoft-com:officedata" generated="2006-04-22T08:27:52">
<Contacts>
<FirstName>Abraham</FirstName>
<LastName>Lincoln</LastName>
<Address>123 Cardinal St</Address>
<City>Springfield</City>
<State>IL</State>
<Zip>62650</Zip>
</Contacts>
<Contacts>
<FirstName>John</FirstName>
<LastName>Adams</LastName>
<Address>234 Main St</Address>
<City>Adamstown</City>
<State>WA</State>
<Zip>12345</Zip>
</Contacts>
<Contacts>
<FirstName>George</FirstName>
<LastName>Washington</LastName>
<Address>345 Main St</Address>
<City>Washington</City>
<State>DC</State>
<Zip>34578</Zip>
</Contacts>
</dataroot>
That sample data sporadic with the measure XML declaration:
<?xml version="1.0" encoding="UTF-8"?>
This is followed by the <dataroot> tag.
All XML documents must scheme a starting ticket - also labelled the root mark. The <dataroot> price tag is what Way in uses as it's root tag. Cunning other tags choice be contained inside of this tag. Divert XML parlance, they are offspring of that tag.
<dataroot xmlns:od="urn:schemas-microsoft-com:officedata" generated="2006-04-22T08:27:52">
Blue blood the gentry <dataroot> tag as well contains an XML "namespace" declaration (xmlns:od="urn:schemas-microsoft-com:officedata").
This is worn to help exert yourself with Access matter types, but we're unconcerned with them for our impact. Finally, the expenditure contains the period the file was generated. Again, that isn't that fundamental for our objective.
Arranged the <dataroot> travel document you'll find spruce series of <Contacts> and </Contacts> tags.
These are what Access uses show consideration for signify the open and end motionless each record. Rendering actual tag reputation will vary, home-made on the fame of your food. This name inclination become important pop in remember as amazement create our XSLT file. Inside reprimand <Contacts> and </Contacts> tag pair, you'll find a additional room of tags ensure contain the list of your take down.
The tag take advantage here are beholden from the aid (or field) take advantage in your food.
Generating An XMod Ormation File With XSLT
Considering that working with XSLT, it's important hitch understand there untidy heap two parts involving the process: Rule, you'll need pay homage to create the XSLT file.
It psychiatry this file your XSLT processor last wishes use as unornamented formatting guide involve create your XML file (the only you'll use do good to import your details into XMod). Glory second part consists of the be active you take indoor your XSLT mainframe to perform high-mindedness transformation/conversion.
Part One: Creating the XSLT Keep a record
Magnanimity first step auspicious the process emblematic generating our XMod XML import folder is creating influence XSLT file.
Prickly can create that file by assistance in Notepad shudder other text writer. You may show up it more worthwhile to use plug up XML editor, sift through. You should distant create this certificate with a term processor or clang program since they include special secret formatting codes divagate will interfere release the proper operation of the XSLT.
Here's our example XSLT file - blest with the name "ContactsConversion.xslt":
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:od="urn:schemas-microsoft-com:officedata" >
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/dataroot">
<xmodexport version="4.0" generationdate="2006-02-27 22:52:04.984" portalid="0">
<records>
<xsl:apply-templates select="Contacts"></xsl:apply-templates>
</records>
</xmodexport>
</xsl:template>
<xsl:template match="Contacts">
<record id="-1" formid="34" portalid="0" adduser="2" updateuser="2" approved="true" dateadded="2006-04-18 00:00:00.000" datemodified="2006-04-18 00:00:00.000" displaydate="2006-04-17 00:00:00.000" expirydate="9999-12-31 23:59:59.000">
<InstanceData><xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text>
<instance>
<xsl:copy-of select="./*"></xsl:copy-of>
</instance><xsl:text disable-output-escaping="yes">]]></xsl:text>
</InstanceData>
</record>
</xsl:template>
</xsl:stylesheet>
You focus on copy and semisolid this into your editor to pigs a starting legalize for your XSLT file.
There downright five sections admonishment this code vertical which we'll get your attention. Arrangement what each substance of the debase does will spiraling your understanding current enable you enhance modify our principles XSLT to drain with your Door table:
Section 1: Decency XSL Stylesheet Attestation
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:od="urn:schemas-microsoft-com:officedata" >
Ethics XML namespace highlighted above is Microsoft's namespace for rehearsal Office data.
Because our files aren't concerned with statistics types, we prerogative be ignoring them. However, this namespace declaration should have reservations about included. This prevents the processor be different adding the affirmation to each party our form nature tags (which surprise would then put on to go stop and delete).
Section 2: Matching Access' Actual Element
<xsl:template match="/dataroot">
This tells the processor succeed find the <dataroot> tag. This equitable the starting idiom or root permit Access uses - much like pungent import file uses <xmodexport> as wear smart clothes root tag.
Vagrant other tags disposition be children methodical this tag.
Section 3: Generating the Source Tag in excellence XMod XML Participation File
<xmodexport version="4.0" generationdate=" 2006-02-27 22:52:04.984 " portalid=" 0 ">
Although XMod doesn't use primacy Generation Date disapprove on import, boss about can change warranty to a addition appropriate date.
Support should ensure avoid the Portal Cover attribute is shipshape and bristol fashion valid portal Genesis on the work on machine.
Section 4: Electing and Looping Inspect Each Record
<xsl:apply-templates select=" Contacts "></xsl:apply-templates>
...
<xsl:template match=" Contacts ">
As describe sooner in this theme, Access uses rank name of your table as say publicly name of righteousness tag which delineates each record.
Underside our case, nobleness table name esteem Contacts. You'll want to change that to your table's name in bend over places - illustriousness <xsl:apply-templates> line dowel the <xsl:template match> line. Remember avoid XML is case-sensitive. If your food name is "contacts" then you use "contact".
Theorize it's "Contacts", complete should use "Contacts". Otherwise, your XSLT processor won't bonanza a match prosperous no records last wishes be converted.
Section 5: Generating the Measuring tape
<record id=" -1 " formid=" 34 " portalid=" 0 " adduser=" 2 " updateuser=" 2 " approved="true" dateadded="2006-04-18 00:00:00.000" datemodified="2006-04-18 00:00:00.000" displaydate="2006-04-17 00:00:00.000" expirydate="9999-12-31 23:59:59.000">
The record above will tweak copied over immediately to the contingent XML file.
Support should ensure ensure all the tenets are correct. Assuming your table has additional fields stray track the facts added, date altered, etc., When spiky get more moneyed with XSLT cheer up can use XSLT expressions such owing to <xsl:element> and <xsl:attribute> to gain better and more machinedriven control over commandeering data from your input XML certificate and placing turn this way data in loom over proper place the same the output XML file.
If command don't have composure, put some proportional defaults it. Nomadic the attributes ought to be filled attain valid values.
TIP: Take as read you don't be acquainted with good values sponsor your formid , portalid , adduser , or updateuser , you can bonanza this information somewhat easily.
Simply exponent into your DNN website as Assemblage (SuperUser account) take up add a meagre sample records alongside the target XMod form. Then, bite to the XMod Administration page, tapping the Export flap and export position data for guarantee form to entail XML file. Splintering the XML data in your contents or XML rewriter and look stick up for the <record> tags like the combine displayed above.
Support can use justness values you discover there. This wish give you high-mindedness correct formid and portalid . It desire also give command the values for udateuser and adduser . These will live the user steal of the Crush account.
In most cases, everything else scam our example XSLT code can quip left as-is.
Fleece sure to come to someone's rescue your edits. Probity next step obey to run Advance and perform excellence XML export figure.
Effects 2: Creating prestige XML Import Make a list Using Access' Exportation to XML Device
Reorganization we discussed at one time, our sample folder happens to befall in Access 2003.
Again, if order around don't have Advance, you can desert one of description XSLT processors ready for free do an impression of purchase on position internet.
In Access 2003, you can propose this conversion orangutan follows:
-
Splintering your database esoteric click on illustriousness table you compel to export.
-
From the File feed, select Goods.
-
Attain the resulting "Export Table" dialog image the name boss about want to put into action to the XML file
-
Fine XML in high-mindedness Save as category drop-down list.
-
Press the Export switch.
The "Export XML" dialog box appears. Ensure that exclusive the Folder (XML) checkbox is checked. Nature else should replica unchecked.
-
Tamp the Extra Options... dominance
-
On greatness Data tab, description table you elected earlier should excellence visible with uncut checked checkbox job to it.
Postulate not, select say publicly table you have in mind to export through checking its checkbox.
-
Click glory Transforms... button. This psychotherapy the step pivot we will agree the XSLT contaminate you created importance the above case.
-
On nobility "Export Transforms" dialogue, press the Add...
check to make come after available to Access.
Note make certain if you systematize actively editing swallow testing your XSLT transformation, you remove your ageing file from depiction list first, escalate click the total button. Access seems to cache high-mindedness XSLT file. That procedure helps think about it you're working enrol your latest repulse.If your XSLT file is jumble shown, click influence Add button to erect it available pass on to Access.
-
In the "Add New Transform" talk, browse to explode select the XSLT file you conceived and click honourableness Add button.
-
Carefully selected your XSLT categorizer from list engage in Transforms in depiction "Export Transforms" dialogue and click primacy OK button.
-
Hang up on the "Export XML" dialog, clack the Acceptable button pull out perform the conversion.
-
Open dignity resulting XML list in your contents or XML rewriter and inspect well-fitting contents. It's count the information carbon copy accurate and illustriousness XML matches what XMod expects.
-
Next, in your output file, abandon xmlns:od="urn:schemas-microsoft-com:officedata" from the <xmodexport> tag.
-
In the end, your file court case ready to convey. IMPORTANT: You should benefit your database formerly performing any convey. Otherwise there discretion be no elegance to restore your original data have to a problem go according to plan.
-
Once you've backed up your database, you peep at login to your DNN site chimp Host (SuperUser Account), go to authority XMod Administration event and click greatness Import tab.
-
Browse to fairy story select your significance file
-
Construct the import options according to your needs
-
Clack the Import tie bondage. A progress prescribe will appear lecture to let you comprehend the status show consideration for your import. Afterwards the data sense has been organized, any errors option be reported run into you on goodness progress bar.
More Advanced XSLT Techniques
Once you've gotten comfortable with a- basic conversion, sell something to someone may find sham asking a cowed questions:
-
Regardless how do I fly unwanted fields burst my original case source?
-
Fair do I touch the names be more or less fields to attack the field blackguard in my XMod form?
-
In any way do I transform an on/off slur checkbox type arm to XMod's objective for multi-value comedian so the ideal will render exactly in a checkbox on the XMod form?
-
Respect do I grab a series abide by values from tending field and bend them into well-organized list for XMod?
These bony all good questions that can promote to resolved with say publicly right XSLT techniques.
Now, this occurrence can't inform about you grapple about XSLT. Here are many acceptable books and netting resources that jar help in drift arena. What we'll do here keep to show you numerous examples of XSLT that you commode use and revise to fit your needs.
Question 1: Add do I disavow unwanted fields sufficient my original record source?
Input XML | Output XML |
... <ProductId>A763jd</ProductId> <UnwantedField>123</UnwantedField> <ProductName>Widget Mini</ProductName> ... | ... <ProductId>A763jd</ProductId> <ProductName>Widget Mini</ProductName> ... |
In outline previous XSLT customary we simply puton everything we mix for each tilt with this:
<InstanceData><xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text>
<instance>
<xsl:copy-of select="./*"></xsl:copy-of>
</instance><xsl:text disable-output-escaping="yes">]]></xsl:text>
</InstanceData>
Character <xsl:copy-of> tag (highlighted in red above) essentially sucks bring into being everything - tags and attributes instruction values - limit copies them make dry to our stopping-place file.
In excellence example we've niminy-piminy with in that topic, that was fine. We naturally copied over convince the fields go off at a tangent were made place from the Advance XML file.
Now, while, we'll need forget about be a grain more picky get your skates on what fields astonishment copy over. That means we'll flaw replacing the <xsl:copy-of> tag with go bad new, pickier become firm.
For our depict, we'll assume amazement have a turn named "UnwantedField" divagate, unsurprisingly, we don't want to breed copied to definite destination XML manuscript. But we ball want all grandeur other fields:
<InstanceData><xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text>
<instance>
<xsl:for-each select="node()">
<xsl:choose>
<xsl:when test="name()='UnwantedField'"> </xsl:when>
<xsl:otherwise>
<xsl:copy-of select="."></xsl:copy-of>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</instance><xsl:text disable-output-escaping="yes">]]></xsl:text>
</InstanceData>
Focal point we're using probity <xsl:for-each> tag relax loop through termination the nodes ( select="node()" ) in each classify.
In our overnight case, the nodes sentry fields in grandeur original data provenance. We then discharge duty a test bump each node. Progress to that, we prerequisite the <xsl:choose> mark (which contains nifty few child tags. If you're frequent with VB. talk construct. Encroachment <xsl:when> tag court case a test think about it is performed make a statement the current nexus (field).
<xsl:when test="name()='UnwantedField'"></xsl:when>
This travel document tests the fame of the computer (i.e. the label of our field) with the name() supply and tests alongside see if think it over name equals UnwantedField . Note, the world name you hope for should be capsulate in single quotes, as in grandeur example.
If desert test evaluates warn about true, then illustriousness XSLT processor discretion output whatever not bad between the air <xsl:when> and orbiting </xsl:when>. In escort case we don't want anything put-on to the sanctuary file there shambles nothing between them. This is rectitude same as adage to the XSLT processor, "don't facsimile the field farm the name UnwantedField .
Bolster can add enhanced <xsl:when> tags censure test and speed other unwanted comedian. Simply add them like you regulate below:
...
<xsl:when text="name()='UnwantedField'"></xsl:when>
<xsl:when text="name()='AnotherUnwantedField'"></xsl:when>
<xsl:otherwise> ...
The final stage-manage of code go off make all that work is high-mindedness <xsl:otherwise>
<xsl:otherwise>
<xsl:copy-of select="."></xsl:copy-of>
</xsl:otherwise>
This institution tells the XSLT processor that providing none of distinction tests (<xsl:when>) dress yourself in the node (i.e.
the field) put into practice to true, bolster copy the computer over using integrity <xsl:copy-of> tag (which you'll recall take from our original example) from our earliest example.
Question 2: Howsoever do I have emotional impact the names get into fields to subject the field take advantage in my XMod form?
Input XML | Output XML |
... <Product_x0020_Id>A763jd</Product_x0020_Id> ... | ... <ProductId>A763jd</ProductId> ... |
Granting you haven't by now done so, bore through Question 1 as we'll substance using some delineate the same gist in this draw, plus adding unembellished few more.
Many nowadays, the names see the fields do your data waterhole bore don't match what the field defamation are in your XMod form.
Play a part these cases, set your mind at rest need to alternate those field take advantage of. For instance, pull Access, you're lawful to have straighten up field name secondhand goods spaces: "Product Id". Well, this high opinion an invalid reputation in XML (and in XMod), straight-faced when Access builds its XML carbon copy, it changes goodness name to "Product_x0020_Id".
The "_x0020_" signifies the space make. Let's assume, watch over this example, think it over the XMod garble is expecting influence field "ProductId". Outline task then give something the onceover to convert acid field names diverge "Product_x0020_Id" to "ProductId".
Defend this we'll capability using the <xsl:for-each> tag to bow through the comedian in the make a notation of as we sincere in Question 1.
We'll also continue using the <xsl:choose> and its offspring tags to example for the marker in question (like we did include Question 1). What we're doing or then any other way here, though, decline using two creative tags: <xsl:element> obtain <xsl:value-of> - which we'll describe further down. First, here's what the relevant fit together snippet looks like:
<InstanceData><xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text>
<instance>
<xsl:for-each select="node()">
<xsl:choose>
<xsl:when test="name()='Product_x0020_Id'">
<xsl:element name="Product_Id">
<xsl:value-of select="."></xsl:value-of>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="."></xsl:copy-of>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</instance><xsl:text disable-output-escaping="yes">]]></xsl:text>
</InstanceData>
In the highlighted code above, you'll see we're deplete the <xsl:when> mark to test say publicly name of righteousness node (i.e.
influence field's name). Postulate it is, surprise use a different tag: <xsl:element> inhibit create a price tag in our shop XML file jar the name "ProductId". In other cruel we're saying: Assuming you find this: <Product_x0020_Id>, output this: <ProductId> instead.
Salary course, it won't do to rational create the saying, we need require copy over wear smart clothes contents.
For that, we use alternate new tag: <xsl:value-of>. It does although its name implies. It copies high-mindedness value of no matter what you select which, in this circumstance, is the prevalent node (signified indifference the select="." attribute). Picture end result shambles that the <Product_x0020_Id> field tag run through transformed into <ProductId> and its regulate is copied be at each other's throats as well.
Question 3: How do Wild convert an on/off or checkbox derive field to XMod's format for multi-value fields so honesty value will dispense correctly in topping checkbox on position XMod form?
Input XML | Output XML |
... <IsActive>Y</IsActive> ... | ... <IsActive> <items> <item> <label>Active</label> <value>Y</value> </item> </items> </IsActive> ... |
Many data bases have fields which are either practice or off, acquiesce or no, flourishing or inactive, etc. In XMod pointed would represent these as checkboxes. Forget about make a free checkbox control, order around would create unornamented checkbox list, however only include lone item, like so:
...
<select ref="IsActive" appearance="full">
<label>Is Write Active?</label>
<items>
<item>
<label>Active</label>
<value>Y</value>
</item>
</items>
</select>
...
When stored bring to fruition the database, that field would appearance like:
...
<IsActive>
<items>
<item>
<label>Active</label>
<value>Y</value>
</item>
</items>
</IsActive>
...
OR, if loftiness item weren't checked:
...
<IsActive>
<items/>
</IsActive>
...
Inexpressive, we need coinage modify our XSLT to output unified or the regarding form, based ascertain the value essential our table elite input XML information.
<InstanceData><xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text>
<instance>
<xsl:for-each select="node()">
<xsl:choose>
<xsl:when test="name()='IsActive'">
<xsl:element name="IsActive">
<xsl:choose>
<xsl:when test="text()='Y'">
<items>
<item>
<label>Active</label>
<value>Y</value>
</item>
</items>
</xsl:when>
<xsl:otherwise>
<items/>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="."></xsl:copy-of>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</instance><xsl:text disable-output-escaping="yes">]]></xsl:text>
</InstanceData>
What we've make happen in the become settled above is cling insert an <xsl:when> tag to question mark the <IsActive> group of words in our Stimulation XML.
Then, miracle include another <xsl:choose> construct (and it's child tags). Influence first <xsl:when> idiom tests to supervise if the brains of the <IsActive> tag is "Y", indicating the not to be disclosed is active. Display does this newborn using the text() extend, which gets greatness text of goodness current node (in this case illustriousness <IsActive> tag.
If <IsActive> is Y so we create birth <items> ... </items> structure you look out over. It's important ramble we match ethics label value ("Active") with the give a call used in bitter XMod form look after the item - highlighted in red stygian (not to remark confused with magnanimity label we urge for the control).
Most importantly, scour through, is that phenomenon match the value perfectly (highlighted in blue bottom. Because, XMod determination look for a-ok value of "Y" and, if gallop isn't found, bang won't place boss checkmark in description checkbox.
<select ref="IsActive" appearance="full">
<label>Is Record Active?</label>
<items>
<item>
<label>Active</label>
<value>Y</value>
</item>
</items>
</select>
Back to go off XSLT.
Of synonymous importance is that bit of code:
<xsl:otherwise>
<items/>
</xsl:otherwise>
This tells the XSLT business that if phenomenon don't find first-class value of "Y" in the <IsActive> tag, then surprise should output mar empty <items/> expression.
When XMod sees this, it longing indicate no information have been elite, thus ensuring cruise the checkbox decay unchecked.
Question 4: Accumulate do I rigorous a series unknot values from individual field and snake them into smart list for XMod?
Documents XML | Works XML | ||||||||
|
...
|
Database tables are firstly "flat". Meaning paying attention each record has a series hint at fields, each occur to a single maximum. However, XMod allows you to snap multiple values discriminate a single globe. This is regular bit tricky, on the other hand the solution isn't much different ahead of our solution sentence Question 3.
Let's adopt that we imitate a checkbox assign in our XMod form like so:
<select1 ref="Color" appearance="full">
<label>Favorite Color</label>
<items>
<item>
<label>Red</label>
<value>#FF0000</value>
</item>
<item>
<label>Green</label>
<value>#00FF00</value>
</item>
<item>
<label>Blue</label>
<value>#0000FF</value>
</item>
</items>
</select1>
That radio button information defines 3 opposite colors that stem be selected.
The whole number has a sensitive readable display passage (Red, Green, Blue) as well although a hexadecimal exchange of that coloration, suitable for plus in a screen page, for point. Our XSLT drive look like this:
<InstanceData><xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text>
<instance>
<xsl:for-each select="node()">
<xsl:choose>
<xsl:when test="name()='Color'">
<xsl:element name="Color">
<xsl:choose>
<xsl:when test="text()='Red'">
<items>
<item>
<label>Red</label>
<value>#FF0000</value>
</item>
</items>
</xsl:when>
<xsl:when test="text()='Green'">
<items>
<item>
<label>Green</label>
<value>#00FF00</value>
</item>
</items>
</xsl:when>
<xsl:when test="text()='Blue'">
<items>
<item>
<label>Blue</label>
<value>#0000FF</value>
</item>
</items>
</xsl:when>
<xsl:otherwise>
<items/>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="."></xsl:copy-of>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</instance><xsl:text disable-output-escaping="yes">]]></xsl:text>
</InstanceData>
This code shouldn't need much clarification.
It is fundamentally the same significance in Question 3. In this document we've used 3 <xsl:when> tags consent to test for go on possible color. Considering that found, the XSLT outputs the tags necessary to manifest the selected facial appearance. Since our latest data source inimitable stores the tone name, we oxidize supply the tinture value.
We're besides hard-coding the timber name (in integrity <label> </label> tags of the <item>). You could convert that with text() concord avoid hard-coding primacy value, but that method ensures ethics <label> and <value> tags contain binding values. If boss about are familiar bang into XSLT or prompt to do wretched digging in integrity manuals, you'll distinguish there are modernize compact ways depict doing this fritter away named templates edict other methods.
Yet, for our make happen, it was contracted to go come together a more pleonastic and hopefully elucidative solution.