Product Attribute Starting With A Number

Permalink Browser Info Environment
I have a Product Attribute called <3d_name>. When I add it to the XML file, it won't allow me to import the data. When I remove it, it imports fine. Is there something about XML or the Import addon that doesn't like the name starting with a number?

Type: Discussion
Status: In Progress
TeKnoZiz
View Replies:
tbcrowe replied on at Permalink Reply
tbcrowe
I would not think a product attribute handle that starts with a number would be a problem, but I don't recall ever trying it myself. Have you checked the c5 log to see if there is an error there? It may provide more information.
TeKnoZiz replied on at Permalink Reply
TeKnoZiz
Yes there is an error. Import Error: Invalid XML file. Check the following errors:
Fatal Error 5: Extra content at the end of the document (line 28, column: 1)
TeKnoZiz replied on at Permalink Reply
TeKnoZiz
I have seen this error before when there was a character outside the brackets, but I can't seem to find anything wrong with the syntax... <3d_name>Name</3d_name>, right?
tbcrowe replied on at Permalink Reply
tbcrowe
I did a little research into this. It turns out it is illegal for XML tags to start with a number; the spec prohibits it. From what I've read there is no way around this. So, while Import doesn't care if the tag starts with a number, since Import is designed to use XML you will need to rename your product attribute.
TeKnoZiz replied on at Permalink Reply
TeKnoZiz
That's great, man, just changed a couple of lines of code and the attribute name, and we should be all set. Thanks! Love your addon. Saves me hours of time.

concrete5 Environment Information

# concrete5 Version
5.6.3.2

# concrete5 Packages
Amiant CSS3 Menu (0.3), Awkward Slider (1.0.4), eCommerce (2.8.12), eCommerce Import (2.4.11), eCommerce Product Slider (1.1.4), FlexSlider (2.2.0.5), Login (1.1.1), Mailing List (2.54), Photo Swipe (3.0.5.5), Popup Login (1.0.5), Shop (1.2.4), Social Class (1.2), Zoom Image (1.0.5).

# concrete5 Overrides
blocks/amiant_css3_menu, blocks/autonav, blocks/flexslider, blocks/login, blocks/product_slider, blocks/social_class, elements/product, single_pages/register.php, themes/shop

# concrete5 Cache Settings
Block Cache - On
Overrides Cache - On
Full Page Caching - On - If blocks on the particular page allow it.
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
Apache

# Server API
cgi-fcgi

# PHP Version
5.2.17

# PHP Extensions
bcmath, bz2, calendar, cgi-fcgi, ctype, curl, date, dba, dbase, dom, exif, filter, ftp, gd, gettext, hash, iconv, idn, imap, json, libxml, mbstring, mcrypt, mhash, mysql, mysqli, openssl, pcre, PDO, pdo_mysql, pdo_sqlite, posix, Reflection, session, shmop, SimpleXML, soap, SPL, SQLite, standard, tidy, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, zip, zlib.

# PHP Settings
max_execution_time - 50000
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - -1
max_input_vars - 5000
memory_limit - 90M
post_max_size - 8M
safe_mode - Off
safe_mode_exec_dir - /usr/local/php/bin
safe_mode_gid - Off
safe_mode_include_dir - <i>no value</i>
sql.safe_mode - Off
upload_max_filesize - 40M
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
mysqli.max_links - Unlimited
pcre.backtrack_limit - 100000
pcre.recursion_limit - 100000
session.cache_limiter - nocache
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5
safe_mode_allowed_env_vars - PHP_
safe_mode_protected_env_vars - LD_LIBRARY_PATH

Browser User-Agent String

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.