Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Salesforce by (11.9k points)

I'm trying to use xmllint to reformat our VisualForce code. My command line is "xmllint --format --recover filename.page".

Though the formatting (especially script sections) work out well, all the tags with apex inside them are modified to eliminate "apex."

For instance, "apex:page" is replaced with "page.". Obviously, this makes the reformatting useless.

While processing, xmllint complains about the namespace. In the example below I just use the namespace "ns." Notice how the output removes the "ns."

tgagne@ubuntu:~/tmp$ xmllint --format --recover a.xml

a.xml:1: namespace error : Namespace prefix ns on a is not defined

<ns:a>

     ^

<?xml version="1.0"?>

<a>

</a>

1 Answer

0 votes
by (32.1k points)

To add to the answer that collapsar made, here are some of the namespaces that are used in Salesforce's Enterprise WSDL. Might be a good idea to start with these, or take a look at the other WSDLs they have published. (See http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_partner.htm for more details.)

xmlns:tns="urn:enterprise.soap.sforce.com"

xmlns:fns="urn:fault.enterprise.soap.sforce.com"

xmlns:ens="urn:sobject.enterprise.soap.sforce.com"

Edit: Just took a look at the metadata for our Apex classes and found this namespace, which might be useful:

xmlns="http://soap.sforce.com/2006/04/metadata"

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...